From 21c5eeba673694f865badfd137ee9fc474177ae0 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Sun, 4 Sep 2022 12:31:10 +0200 Subject: [PATCH] QOffsetStringArray: fix ambiguous qOffsetStringArray overloads There are two qOffsetStringArray overloads: one in QT_NAMESPACE, the other in QT_PREPEND_NAMESPACE(QtPrivate). In TUs which use using namespace QtPrivate, a call to qOffsetStringArray() may become ambiguous. Fix by renaming the qOffsetStringArray() to makeOffsetStringArray(). Pick-to: 6.4 6.3 6.2 Change-Id: I242a969f363e230d6a8dfb048601a0c024724f6a Reviewed-by: Thiago Macieira --- src/corelib/tools/qoffsetstringarray_p.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/corelib/tools/qoffsetstringarray_p.h b/src/corelib/tools/qoffsetstringarray_p.h index a3b56badc6..aa25f575be 100644 --- a/src/corelib/tools/qoffsetstringarray_p.h +++ b/src/corelib/tools/qoffsetstringarray_p.h @@ -125,7 +125,7 @@ template struct StaticMapEntry }; template -constexpr auto qOffsetStringArray(StringExtractor extractString, const T &... entries) +constexpr auto makeOffsetStringArray(StringExtractor extractString, const T &... entries) { constexpr size_t Count = sizeof...(T); constexpr qsizetype StringLength = (sizeof(extractString(T{})) + ...); @@ -147,7 +147,7 @@ template constexpr auto qOffsetStringArray(const char (&...strings)[Nx]) noexcept { auto extractString = [](const auto &s) -> decltype(auto) { return s; }; - return QtPrivate::qOffsetStringArray(extractString, QtPrivate::StaticString(strings)...); + return QtPrivate::makeOffsetStringArray(extractString, QtPrivate::StaticString(strings)...); } QT_WARNING_POP