Moc: don't stumple over inline namespace in more places

Ignore the 'inline' in case of nested namespace with another
nested inline namespace.

Amends 5222df2be7

Fixes: QTBUG-117765
Pick-to: 6.6 6.5
Change-Id: I87f2649606f63c818f225f8cc5ec914920763c5f
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This commit is contained in:
Fabian Kosmale 2023-11-23 14:47:45 +01:00 committed by Michal Klocek
parent 905593a40b
commit d39353085e
2 changed files with 6 additions and 1 deletions

View File

@ -706,8 +706,10 @@ void Moc::parse()
switch (next()) { switch (next()) {
case NAMESPACE: case NAMESPACE:
if (test(IDENTIFIER)) { if (test(IDENTIFIER)) {
while (test(SCOPE)) while (test(SCOPE)) {
test(INLINE); // ignore inline namespaces
next(IDENTIFIER); next(IDENTIFIER);
}
if (test(EQ)) { if (test(EQ)) {
// namespace Foo = Bar::Baz; // namespace Foo = Bar::Baz;
until(SEMIC); until(SEMIC);

View File

@ -77,6 +77,9 @@ const char *string_hash_hash = STRING_HASH_HASH("baz");
of writing this comment. of writing this comment.
*/ */
namespace A::inline B {} namespace A::inline B {}
namespace A {
namespace B::inline C {}
}
#endif #endif
Q_DECLARE_METATYPE(const QMetaObject*); Q_DECLARE_METATYPE(const QMetaObject*);