tst_moc: fix Clang -Winline-namespace-reopened-noninline

Says Clang:

  tst_moc.cpp:86:14: warning: inline namespace reopened as a non-inline namespace [-Winline-namespace-reopened-noninline]
     86 |    namespace B::inline C {}
        |              ^
        |    inline
  tst_moc.cpp:84:21: note: previous definition is here
     84 | namespace A::inline B {}
        |                     ^

There's no minimally-invasive fix, because neither

   inline namespace B::inline C {}

nor

   namespace inline B::inline C {}

are valid C++.

So wrap the whole thing in another namespace ("Qt_", to avoid clashing
with somthing else, incl. our own namespace Qt), so we have roughly
the same structure as before, but with two non-inline outer namespaces
instead of one.

Amends 5222df2be7d10bf44dfc2971774eadcb526b7a13.

Pick-to: 6.9 6.8 6.5
Change-Id: Ia0e35e87934abebc76b719e3bd8124ac77ea07f5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit b9a43e7767987a0c3bba0ac57fe497fd97418d19)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Marc Mutz 2025-06-12 21:49:11 +02:00 committed by Qt Cherry-pick Bot
parent 7e7f7daa2b
commit da96dfdacc

View File

@ -81,9 +81,9 @@ const char *string_hash_hash = STRING_HASH_HASH("baz");
and also to increase coverage, given how few C++20 configurations exist in the CI at the time
of writing this comment.
*/
namespace A::inline B {}
namespace A {
namespace B::inline C {}
namespace Qt_::A::inline B {}
namespace Qt_ {
namespace A::inline B::inline C {}
}
#endif