diff --git a/src/tools/moc/moc.cpp b/src/tools/moc/moc.cpp index b9f71ddb158..61a5542c830 100644 --- a/src/tools/moc/moc.cpp +++ b/src/tools/moc/moc.cpp @@ -674,6 +674,9 @@ void Moc::parse() if (test(NAMESPACE)) { while (test(SCOPE) || test(IDENTIFIER)) ; + // Ignore invalid code such as: 'using namespace __identifier("x")' (QTBUG-63772) + if (test(LPAREN)) + until(RPAREN); next(SEMIC); } break; diff --git a/tests/auto/tools/moc/namespace.h b/tests/auto/tools/moc/namespace.h index 43d00e82f3e..7f1e46cd62e 100644 --- a/tests/auto/tools/moc/namespace.h +++ b/tests/auto/tools/moc/namespace.h @@ -76,6 +76,7 @@ namespace FooNamespace { #ifdef Q_MOC_RUN namespace __identifier("") {} // QTBUG-56634 +using namespace __identifier(""); // QTBUG-63772 #endif #endif // NAMESPACE_H