diff --git a/src/tools/moc/moc.cpp b/src/tools/moc/moc.cpp index cc5cc929b9..c1fa36c87a 100644 --- a/src/tools/moc/moc.cpp +++ b/src/tools/moc/moc.cpp @@ -706,8 +706,10 @@ void Moc::parse() switch (next()) { case NAMESPACE: if (test(IDENTIFIER)) { - while (test(SCOPE)) + while (test(SCOPE)) { + test(INLINE); // ignore inline namespaces next(IDENTIFIER); + } if (test(EQ)) { // namespace Foo = Bar::Baz; until(SEMIC); diff --git a/tests/auto/tools/moc/tst_moc.cpp b/tests/auto/tools/moc/tst_moc.cpp index b4d5525da3..a7fe0e9455 100644 --- a/tests/auto/tools/moc/tst_moc.cpp +++ b/tests/auto/tools/moc/tst_moc.cpp @@ -77,6 +77,9 @@ const char *string_hash_hash = STRING_HASH_HASH("baz"); of writing this comment. */ namespace A::inline B {} +namespace A { + namespace B::inline C {} +} #endif Q_DECLARE_METATYPE(const QMetaObject*);