summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@woboq.com>2012-10-12 13:37:21 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-10-14 20:53:42 +0200
commit21426f281e09b6043e3c1f9b5d3a48644a4965fe (patch)
tree7e4aa0c5dbd3633d596714b2a86573e23b7287dd /tests
parent289a8147784f830f214859e00367486587d9a027 (diff)
moc: parse properly the gcc extension for variadic macro
Task-number: QTBUG-27547 Change-Id: I983b96b09c405e5330327092e56164b9921a2d0f Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'tests')
-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;