From a2322519929bd36a90422dccc0310b8230729197 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Wed, 14 Jun 2017 08:28:40 +0200 Subject: 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 --- src/tools/moc/moc.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/tools/moc/moc.cpp') 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; -- cgit v1.2.3