Summary: | Signals false positive | ||
---|---|---|---|
Product: | [Developer tools] clazy | Reporter: | eric.lemanissier |
Component: | general | Assignee: | Sergio Martins <smartins> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | smartins |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Other | ||
OS: | Linux | ||
Latest Commit: | https://commits.kde.org/clazy/2e8846f7c58d4f1ea3655057933d17942bd38943 | Version Fixed In: | |
Sentry Crash Report: |
Description
eric.lemanissier
2016-12-20 10:09:53 UTC
thanks, I'll investigate Git commit 234daa48b88a93c12a7e8d08e5ab8b83ca02099e by Sergio Martins. Committed on 20/12/2016 at 15:14. Pushed by smartins into branch 'master'. incorrect-emit: Move to level2 until false-positives are fixed M +1 -1 checks/level1/incorrect-emit.cpp https://commits.kde.org/clazy/234daa48b88a93c12a7e8d08e5ab8b83ca02099e Git commit 789c9eb0cd108ddcc839815901462e12cd60c825 by Sergio Martins. Committed on 21/12/2016 at 23:25. Pushed by smartins into branch 'master'. incorrect-emit: Don't warn about emit in CTOR if inside a lambda The emit can be inside a lambda, which is fine, since it probably will be emitted later and not when CTOR is being run. M +3 -0 checks/level1/incorrect-emit.cpp M +1 -0 tests/incorrect-emit/main.cpp https://commits.kde.org/clazy/789c9eb0cd108ddcc839815901462e12cd60c825 Git commit ca5af76d638c6582ed2466809d6edb0dfb34730e by Sergio Martins. Committed on 24/12/2016 at 10:17. Pushed by smartins into branch 'master'. incorrect-emit: Also honour Q_SLOT and Q_SIGNAL keywords M +42 -12 AccessSpecifierManager.cpp M +1 -0 CMakeLists.txt M +9 -0 tests/incorrect-emit/main.cpp M +7 -5 tests/incorrect-emit/main.cpp.expected https://commits.kde.org/clazy/ca5af76d638c6582ed2466809d6edb0dfb34730e this seems fixed, anything missing ? re-open with a testcase if you spot something, thanks The following example triggers testCase.cpp:13:14: warning: Missing emit keyword on signal call TestClass::otherMethod [-Wclazy-incorrect-emit] return otherMethod(); #include <qobject.h> class TestClass : public QObject { Q_OBJECT public: explicit TestClass(QObject *parent = 0 ) noexcept; int method() { return otherMethod(); } Q_SIGNALS: void someSignal(); public: int otherMethod() { return 1000; } }; Git commit 968595ee454e1b7c51635d0b1ced3902c8ab3984 by Sergio Martins. Committed on 28/12/2016 at 13:22. Pushed by smartins into branch 'master'. incorrect-emit: Add unit-test for a bug that should be fixed M +14 -0 tests/incorrect-emit/main.cpp https://commits.kde.org/clazy/968595ee454e1b7c51635d0b1ced3902c8ab3984 Git commit 2e8846f7c58d4f1ea3655057933d17942bd38943 by Sergio Martins. Committed on 28/12/2016 at 14:00. Pushed by smartins into branch 'master'. incorrect-emit: Fix false-positives with inline method definitions When the methods were defined inside the class it could happen that we were checking a method call before we had gathered all access specifiers. The solution is to visit all access specifiers as soon as we visit the class. Tests pass now too. M +18 -24 AccessSpecifierManager.cpp https://commits.kde.org/clazy/2e8846f7c58d4f1ea3655057933d17942bd38943 |