[clazy] [Bug 407981] New: unneeded-cast incorrectly warns in some circumstances

Nyall Dawson bugzilla_noreply at kde.org
Mon May 27 07:32:44 BST 2019


https://bugs.kde.org/show_bug.cgi?id=407981

            Bug ID: 407981
           Summary: unneeded-cast incorrectly warns in some circumstances
           Product: clazy
           Version: unspecified
          Platform: Other
                OS: Linux
            Status: REPORTED
          Severity: minor
          Priority: NOR
         Component: general
          Assignee: unassigned-bugs at kde.org
          Reporter: nyall.dawson at gmail.com
                CC: smartins at kde.org
  Target Milestone: ---

SUMMARY


STEPS TO REPRODUCE

Run the unneeded-cast check over the code:

    bool someCondition = ...;
    QLabel* label = ...;
    QLineEdit* edit = ...;
    QWidget* w = someCondition ? qobject_cast< QWidget* >( label ) :
qobject_cast< QWidget* >( edit );

Clazy raises the "explicity casting to base is unnecessary" warning, yet the
code will not compile if the casts are removed ("incompatible operand types
QLabel* and QLineEdit*")

OBSERVED RESULT


EXPECTED RESULT


SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the Unassigned-bugs mailing list