summaryrefslogtreecommitdiffstats
path: root/src/tools/moc/moc.cpp
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@woboq.com>2017-06-14 08:28:40 +0200
committerOlivier Goffart (Woboq GmbH) <ogoffart@woboq.com>2017-06-19 07:32:18 +0000
commita2322519929bd36a90422dccc0310b8230729197 (patch)
tree107850a87d9f69824a47ac7241bf7342bfa33be3 /src/tools/moc/moc.cpp
parent56a29f0e91fc48c5eb9062e81a2b45ecc6082cc2 (diff)
Moc: Don't error out when parsing namespace __identifier(...)
Present for example in the Windows's Atlbase.h header. We should not abort the compilation, just ignore that construct Task-number: QTBUG-56634 Change-Id: Id6e4c9f03cb1cef46e330f4fbcae80ce4f3730c6 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/tools/moc/moc.cpp')
-rw-r--r--src/tools/moc/moc.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/tools/moc/moc.cpp b/src/tools/moc/moc.cpp
index 36d84a61d8..4d3ccb8680 100644
--- a/src/tools/moc/moc.cpp
+++ b/src/tools/moc/moc.cpp
@@ -559,6 +559,9 @@ void Moc::parse()
if (test(EQ)) {
// namespace Foo = Bar::Baz;
until(SEMIC);
+ } else if (test(LPAREN)) {
+ // Ignore invalid code such as: 'namespace __identifier("x")' (QTBUG-56634)
+ until(RPAREN);
} else if (!test(SEMIC)) {
NamespaceDef def;
def.classname = nsName;