diff -r 5dc02b23752f -r 3e2da88830cd tests/auto/moc/tst_moc.cpp --- a/tests/auto/moc/tst_moc.cpp Tue Jul 06 15:10:48 2010 +0300 +++ b/tests/auto/moc/tst_moc.cpp Wed Aug 18 10:37:55 2010 +0300 @@ -491,6 +491,7 @@ void typenameWithUnsigned(); void warnOnVirtualSignal(); void QTBUG5590_dummyProperty(); + void QTBUG12260_defaultTemplate(); signals: void sigWithUnsignedArg(unsigned foo); void sigWithSignedArg(signed foo); @@ -1322,6 +1323,46 @@ void foo(struct const_ *) {}; }; + +template +class TestTemplate2 +{ +}; + +class QTBUG11647_constInTemplateParameter : public QObject +{ Q_OBJECT +public slots: + void testSlot(TestTemplate2) {} + void testSlot2(TestTemplate2) {} + void testSlot3(TestTemplate2 const *, + TestTemplate2< TestTemplate2 < void, int > , unsigned char *> > ) {} + +signals: + void testSignal(TestTemplate2); +}; + +class QTBUG12260_defaultTemplate_Object : public QObject +{ Q_OBJECT +public slots: +#if !(defined(Q_CC_GNU) && __GNUC__ == 4 && __GNUC_MINOR__ <= 3) || defined(Q_MOC_RUN) + void doSomething(QHash values = QHash() ) { Q_UNUSED(values); } +#else + // we want to test the previous function, but gcc < 4.4 seemed to have a bug similar to the one moc has. + typedef QHash WorkaroundGCCBug; + void doSomething(QHash values = WorkaroundGCCBug() ) { Q_UNUSED(values); } +#endif + + void doAnotherThing(bool a = (1 < 3), bool b = (1 > 4)) { Q_UNUSED(a); Q_UNUSED(b); } +}; + + +void tst_Moc::QTBUG12260_defaultTemplate() +{ + QVERIFY(QTBUG12260_defaultTemplate_Object::staticMetaObject.indexOfSlot("doSomething(QHash)") != -1); + QVERIFY(QTBUG12260_defaultTemplate_Object::staticMetaObject.indexOfSlot("doAnotherThing(bool,bool)") != -1); +} + + QTEST_APPLESS_MAIN(tst_Moc) #include "tst_moc.moc"