Summary: | unneeded-cast incorrectly warns in some circumstances | ||
---|---|---|---|
Product: | [Developer tools] clazy | Reporter: | Nyall Dawson <nyall.dawson> |
Component: | general | Assignee: | Sergio Martins <smartins> |
Status: | RESOLVED FIXED | ||
Severity: | minor | CC: | smartins |
Priority: | NOR | ||
Version First Reported In: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Other | ||
OS: | Linux | ||
Latest Commit: | https://commits.kde.org/clazy/4918d8efba9b20b273a15ab2dd215a768ff884f9 | Version Fixed In: | |
Sentry Crash Report: |
Description
Nyall Dawson
2019-05-27 06:32:44 UTC
it should still warn, as you should use static_cast instead in that case will fix the warning message Git commit 4918d8efba9b20b273a15ab2dd215a768ff884f9 by Sergio Martins. Committed on 27/05/2019 at 13:12. Pushed by smartins into branch 'master'. unneeded-cast: Improve warning message for unneeded qobject_cast Instead of saying that no cast to base is needed, simply say that no qobject_cast is needed. Since a static_cast might still be needed. This is the case for the ternary operator. M +13 -3 src/checks/manuallevel/unneeded-cast.cpp M +1 -1 src/checks/manuallevel/unneeded-cast.h M +2 -2 tests/unneeded-cast/main.cpp https://commits.kde.org/clazy/4918d8efba9b20b273a15ab2dd215a768ff884f9 |