diff options
-rw-r--r-- | src/tools/moc/moc.cpp | 3 | ||||
-rw-r--r-- | tests/auto/tools/moc/namespace.h | 4 |
2 files changed, 7 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; diff --git a/tests/auto/tools/moc/namespace.h b/tests/auto/tools/moc/namespace.h index 6e04831589..43d00e82f3 100644 --- a/tests/auto/tools/moc/namespace.h +++ b/tests/auto/tools/moc/namespace.h @@ -74,4 +74,8 @@ namespace FooNamespace { } } +#ifdef Q_MOC_RUN +namespace __identifier("<AtlImplementationDetails>") {} // QTBUG-56634 +#endif + #endif // NAMESPACE_H |