Bug 355691

Summary: Missing Q_OBJECT warning generates false positives on template classes
Product: [Developer tools] clazy Reporter: Volker Krause <vkrause>
Component: generalAssignee: Sergio Martins <smartins>
Status: RESOLVED FIXED    
Severity: normal CC: smartins
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

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