Details
-
Task
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
None
-
None
Description
Given a function returning QVariant, if you accidentally `return false` it will silently construct and return a QVariant containing a bool with the value `false`. In modern C++ this could be written as `return
{false}` if it was actually intentional.
Having a warning + fixit in tooling like Clazy would make this easily discoverable.
As a bonus, detect implicit conversion from types with implicit conversion to bool, like smart pointers (see QTBUG-43358).
Attachments
Issue Links
- relates to
-
QTBUG-43358 QVariant implicit construction from smart pointer
-
- Closed
-