From aeb33e44ac4be5225e4ed4343f257f0b4c023f52 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Thu, 12 Jun 2025 21:49:11 +0200 Subject: [PATCH] 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.8 6.5 Change-Id: Ia0e35e87934abebc76b719e3bd8124ac77ea07f5 Reviewed-by: Thiago Macieira Reviewed-by: Fabian Kosmale (cherry picked from commit b9a43e7767987a0c3bba0ac57fe497fd97418d19) Reviewed-by: Qt Cherry-pick Bot (cherry picked from commit da96dfdacc751f8b6c01a1b93300e26e9787b542) --- tests/auto/tools/moc/tst_moc.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/auto/tools/moc/tst_moc.cpp b/tests/auto/tools/moc/tst_moc.cpp index 77f3aa3ecad..a7378b46d76 100644 --- a/tests/auto/tools/moc/tst_moc.cpp +++ b/tests/auto/tools/moc/tst_moc.cpp @@ -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