From ddc6eddf77a5b56243eaa56dec1c5e098353cde9 Mon Sep 17 00:00:00 2001 From: Amir Masoud Abdol Date: Mon, 1 May 2023 10:58:24 +0200 Subject: [PATCH] Resolve symbol ambiguity when building with Unity Build In unity build, we may get `error: reference to 'detail' is ambiguous` between the `detail` namespace defined in `qpropertyprivate.h`, and `qflatmap_p.h`. For now, this causes an issue during the compilation of `qcalendar.cpp` and it may occur in other places where qflatmap is included. Task-number: QTBUG-109394 Change-Id: Ie4bbb66543d26a5db58488e924333d98ce0adebf Reviewed-by: Joerg Bornemann Reviewed-by: Fabian Kosmale Reviewed-by: Qt CI Bot (cherry picked from commit a0923d5d3a4fa1dd03075aa50766224ac1d6e103) Reviewed-by: Qt Cherry-pick Bot --- src/corelib/tools/qflatmap_p.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/corelib/tools/qflatmap_p.h b/src/corelib/tools/qflatmap_p.h index 68ab567439e..7fce7c43af0 100644 --- a/src/corelib/tools/qflatmap_p.h +++ b/src/corelib/tools/qflatmap_p.h @@ -83,6 +83,7 @@ public: } }; +namespace qflatmap { namespace detail { template class QFlatMapMockPointer @@ -100,6 +101,7 @@ public: } }; } // namespace detail +} // namespace qflatmap template, class KeyContainer = QList, class MappedContainer = QList> @@ -107,8 +109,9 @@ class QFlatMap : private QFlatMapValueCompare { static_assert(std::is_nothrow_destructible_v, "Types with throwing destructors are not supported in Qt containers."); - template - using mock_pointer = detail::QFlatMapMockPointer; + template + using mock_pointer = qflatmap::detail::QFlatMapMockPointer; + public: using key_type = Key; using mapped_type = T;