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-b...@kde.org Reporter: nyall.daw...@gmail.com CC: smart...@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 watching all bug changes.