summaryrefslogtreecommitdiffstats
path: root/tests/auto/moc
diff options
context:
space:
mode:
authorOlivier Goffart <olivier.goffart@nokia.com>2010-06-30 13:52:20 (GMT)
committerOlivier Goffart <olivier.goffart@nokia.com>2010-06-30 15:27:27 (GMT)
commit01648005f1f546dc0281155fecd94b4f47a94584 (patch)
tree4ab00c221ba86cb4f977b8cda73d469389868d9f /tests/auto/moc
parent7d80cd1f66fa6331c926674870d2a0dbe2921e77 (diff)
downloadQt-01648005f1f546dc0281155fecd94b4f47a94584.zip
Qt-01648005f1f546dc0281155fecd94b4f47a94584.tar.gz
Qt-01648005f1f546dc0281155fecd94b4f47a94584.tar.bz2
Moc: fix compilation when templated types with multiple arguments are used.
Each template argument need to be normalized separately. Else, the const type of one argument may end up moved in the first argument. (And then the compilation of the generated moc file would fail as the types would not match) Reviewed-by: Kent Hansen Task-number: QTBUG-11647
Diffstat (limited to 'tests/auto/moc')
-rw-r--r--tests/auto/moc/tst_moc.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/auto/moc/tst_moc.cpp b/tests/auto/moc/tst_moc.cpp
index a56d842..19f3677 100644
--- a/tests/auto/moc/tst_moc.cpp
+++ b/tests/auto/moc/tst_moc.cpp
@@ -1322,6 +1322,25 @@ public slots:
void foo(struct const_ *) {};
};
+
+template<typename T1, typename T2>
+class TestTemplate2
+{
+};
+
+class QTBUG11647_constInTemplateParameter : public QObject
+{ Q_OBJECT
+public slots:
+ void testSlot(TestTemplate2<const int, const short*>) {}
+ void testSlot2(TestTemplate2<int, short const * const >) {}
+ void testSlot3(TestTemplate2<TestTemplate2 < const int, const short* > const *,
+ TestTemplate2< TestTemplate2 < void, int > , unsigned char *> > ) {}
+
+signals:
+ void testSignal(TestTemplate2<const int, const short*>);
+};
+
+
QTEST_APPLESS_MAIN(tst_Moc)
#include "tst_moc.moc"