summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/tools/moc/parse-defines.h12
-rw-r--r--tests/auto/tools/moc/tst_moc.cpp6
2 files changed, 18 insertions, 0 deletions
diff --git a/tests/auto/tools/moc/parse-defines.h b/tests/auto/tools/moc/parse-defines.h
index bc22444b5b..eb47253587 100644
--- a/tests/auto/tools/moc/parse-defines.h
+++ b/tests/auto/tools/moc/parse-defines.h
@@ -65,6 +65,14 @@
#if defined(Q_COMPILER_VARIADIC_MACROS)
#define PD_VARARG(x, ...) x(__VA_ARGS__)
+
+#if defined(Q_CC_GNU) || defined(Q_MOC_RUN)
+//GCC extension for variadic macros
+#define PD_VARARGEXT(x, y...) x(y)
+#else
+#define PD_VARARGEXT(x, ...) x(__VA_ARGS__)
+#endif
+
#endif
PD_BEGIN_NAMESPACE
@@ -95,6 +103,10 @@ public slots:
PD_VARARG(void vararg1) {}
PD_VARARG(void vararg2, int) {}
PD_VARARG(void vararg3, int, int) {}
+
+ PD_VARARGEXT(void vararg4) {}
+ PD_VARARGEXT(void vararg5, int) {}
+ PD_VARARGEXT(void vararg6, int, int) {}
#endif
};
diff --git a/tests/auto/tools/moc/tst_moc.cpp b/tests/auto/tools/moc/tst_moc.cpp
index 0cd6c295cc..d861b84e00 100644
--- a/tests/auto/tools/moc/tst_moc.cpp
+++ b/tests/auto/tools/moc/tst_moc.cpp
@@ -2744,6 +2744,12 @@ void tst_Moc::parseDefines()
QVERIFY(index != -1);
index = mo->indexOfSlot("vararg3(int,int)");
QVERIFY(index != -1);
+ index = mo->indexOfSlot("vararg4()");
+ QVERIFY(index != -1);
+ index = mo->indexOfSlot("vararg5(int)");
+ QVERIFY(index != -1);
+ index = mo->indexOfSlot("vararg6(int,int)");
+ QVERIFY(index != -1);
#endif
int count = 0;