summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@woboq.com>2017-06-03 14:07:52 +0200
committerThiago Macieira <thiago.macieira@intel.com>2017-06-06 22:53:07 +0000
commit94a2aec05bcd40194354107eb8264bf28cbd2b19 (patch)
tree35fa372b912c86119b2fe1dab2a3fea7bb0b06fe /tests
parent74111ce590ec8b40ee48e828c238bbfb1bf41aaa (diff)
moc: Don't error out when defining a keyword
Normaly, in C++ It's not valid to define a keyword, but it turns out that some system header do, so we just silently accept it. [ChangeLog][moc] moc no longer errors out if a C++ keyword is #define'ed Task-number: QTBUG-61204 Change-Id: Ia4d3ff9c77b6ff261b6140c220cfb81bd13f1d6d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/tools/moc/parse-defines.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/auto/tools/moc/parse-defines.h b/tests/auto/tools/moc/parse-defines.h
index 6100bf67ad..7b0fa29d7c 100644
--- a/tests/auto/tools/moc/parse-defines.h
+++ b/tests/auto/tools/moc/parse-defines.h
@@ -146,6 +146,15 @@ signals:
#undef QString
+#ifdef Q_MOC_RUN
+// Normaly, redefining keywords is forbidden, but we should not abort parsing
+#define and &&
+#define and_eq &=
+#define bitand &
+#define true 1
+#undef true
+#endif
+
PD_END_NAMESPACE
#endif