Bug 355691 - Missing Q_OBJECT warning generates false positives on template classes
Summary: Missing Q_OBJECT warning generates false positives on template classes
Status: RESOLVED FIXED
Alias: None
Product: clazy
Classification: Developer tools
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Sergio Martins
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-11-21 13:32 UTC by Volker Krause
Modified: 2015-11-22 18:13 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Volker Krause 2015-11-21 13:32:31 UTC
moc wont accept Q_OBJECT in template classes

Reproducible: Always

Steps to Reproduce:
diff --git a/tests/missing-qobject/main.cpp b/tests/missing-qobject/main.cpp
index c119429..f55da27 100644
--- a/tests/missing-qobject/main.cpp
+++ b/tests/missing-qobject/main.cpp
@@ -26,3 +26,8 @@ public: // Warning
 
 class QFile;
 class FwdDecl;
+
+template <typename T> class DerivedTemplate : public Derived1
+{
+public:
+};
Comment 1 Sergio Martins 2015-11-22 18:13:18 UTC
Git commit 5b98970f6e21dc22eccee72467e8abbedf391143 by Sergio Martins.
Committed on 22/11/2015 at 18:12.
Pushed by smartins into branch 'master'.

missing-qobject: Don't warn on missing Q_OBJECT in template classes

moc doesn't support it

M  +3    -0    checks/missing-qobject.cpp
M  +5    -0    tests/missing-qobject/main.cpp

http://commits.kde.org/clazy/5b98970f6e21dc22eccee72467e8abbedf391143