summaryrefslogtreecommitdiffstats
path: root/tests/auto/tools/moc
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/tools/moc')
-rw-r--r--tests/auto/tools/moc/forward-declared-param.h1
-rw-r--r--tests/auto/tools/moc/forwarddeclaredparam.h5
-rw-r--r--tests/auto/tools/moc/parse-defines.h1
-rw-r--r--tests/auto/tools/moc/tst_moc.cpp16
4 files changed, 18 insertions, 5 deletions
diff --git a/tests/auto/tools/moc/forward-declared-param.h b/tests/auto/tools/moc/forward-declared-param.h
index 3c10b7be1f..484e546482 100644
--- a/tests/auto/tools/moc/forward-declared-param.h
+++ b/tests/auto/tools/moc/forward-declared-param.h
@@ -30,6 +30,7 @@
#define FORWARD_DECLARED_PARAM_H
#include <qobject.h>
#include <qmetatype.h>
+Q_MOC_INCLUDE("forwarddeclaredparam.h")
// test support for const refs to forward-declared structs in parameters
diff --git a/tests/auto/tools/moc/forwarddeclaredparam.h b/tests/auto/tools/moc/forwarddeclaredparam.h
new file mode 100644
index 0000000000..176f0c3356
--- /dev/null
+++ b/tests/auto/tools/moc/forwarddeclaredparam.h
@@ -0,0 +1,5 @@
+#ifndef FORWARDDECLAREDPARAM_H
+#define FORWARDDECLAREDPARAM_H
+struct ForwardDeclaredParam {};
+template <typename T> class ForwardDeclaredContainer {};
+#endif
diff --git a/tests/auto/tools/moc/parse-defines.h b/tests/auto/tools/moc/parse-defines.h
index bd22b0b9af..b88fe63e4a 100644
--- a/tests/auto/tools/moc/parse-defines.h
+++ b/tests/auto/tools/moc/parse-defines.h
@@ -30,6 +30,7 @@
#define PARSE_DEFINES_H
#include <qobject.h>
+Q_MOC_INCLUDE(<QMap>)
// this is intentionally ugly to test moc's preprocessing capabilities
#define PD_NAMESPACE PD
diff --git a/tests/auto/tools/moc/tst_moc.cpp b/tests/auto/tools/moc/tst_moc.cpp
index 2fe5f42609..d4e3a4e297 100644
--- a/tests/auto/tools/moc/tst_moc.cpp
+++ b/tests/auto/tools/moc/tst_moc.cpp
@@ -1773,14 +1773,20 @@ public slots:
QString const returnConstString2( QString const s) { return s; }
};
+
+struct science_constant {};
+struct science_const {};
+struct constconst {};
+struct const_ {};
+
class QTBUG9354_constInName: public QObject
{ Q_OBJECT
public slots:
- void slotChooseScientificConst0(struct science_constant const &) {};
- void foo(struct science_const const &) {};
- void foo(struct constconst const &) {};
- void foo(struct constconst *) {};
- void foo(struct const_ *) {};
+ void slotChooseScientificConst0(science_constant const &) {};
+ void foo(science_const const &) {};
+ void foo(constconst const &) {};
+ void foo(constconst *) {};
+ void foo(const_ *) {};
};