diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2023-12-05 05:37:37 -0800 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2023-12-08 14:03:55 -0800 |
commit | ead408ca1b0b689bea269543117d89316ab23d0b (patch) | |
tree | 5fc9fe2da719e54445482d053fabb61d3f07fb9f /src/corelib/kernel | |
parent | 0d85d0a72fd0136bd89e201d0cc1bf7fac2c24c8 (diff) |
QMetaType: fix typenameHelper() for types in the QtPrivate namespace
GCC at some point decided that it wouldn't include the full namespace
expansion in __PRETTY_FUNCTION__ for any type that is in the same
namespace as the template function being expanded (that is, the
QtPrivate) namespace. I don't know how long this behavior has been in
place, but it can be seen with GCC 13, where the expansion of that macro
inside QtPrivate::typenameHelper<QtPrivate::ModelIndex>() is:
constexpr auto QtPrivate::typenameHelper() [with T = ModelIndex]
This can be easily worked around by using a different namespace.
Fixes: QTBUG-119650
Pick-to: 6.6 6.5 6.2
Change-Id: Ica7a43f6147b49c187ccfffd179df309e43a70cb
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/corelib/kernel')
-rw-r--r-- | src/corelib/kernel/qmetatype.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/corelib/kernel/qmetatype.h b/src/corelib/kernel/qmetatype.h index 02ecaf9831..5528c2f459 100644 --- a/src/corelib/kernel/qmetatype.h +++ b/src/corelib/kernel/qmetatype.h @@ -2235,6 +2235,7 @@ struct is_std_pair<std::pair<T1_, T2_>> : std::true_type { using T2 = T2_; }; +namespace TypeNameHelper { template<typename T> constexpr auto typenameHelper() { @@ -2276,15 +2277,15 @@ constexpr auto typenameHelper() QT_STRINGIFY(QT_NAMESPACE) "::" #endif #if defined(Q_CC_MSVC) && defined(Q_CC_CLANG) - "auto __cdecl QtPrivate::typenameHelper(void) [T = " + "auto __cdecl QtPrivate::TypeNameHelper::typenameHelper(void) [T = " #elif defined(Q_CC_MSVC) - "auto __cdecl QtPrivate::typenameHelper<" + "auto __cdecl QtPrivate::TypeNameHelper::typenameHelper<" #elif defined(Q_CC_CLANG) - "auto QtPrivate::typenameHelper() [T = " + "auto QtPrivate::TypeNameHelper::typenameHelper() [T = " #elif defined(Q_CC_GHS) - "auto QtPrivate::typenameHelper<T>()[with T=" + "auto QtPrivate::TypeNameHelper::typenameHelper<T>()[with T=" #else - "constexpr auto QtPrivate::typenameHelper() [with T = " + "constexpr auto QtPrivate::TypeNameHelper::typenameHelper() [with T = " #endif ) - 1; #if defined(Q_CC_MSVC) && !defined(Q_CC_CLANG) @@ -2310,6 +2311,8 @@ constexpr auto typenameHelper() return result; } } +} // namespace TypeNameHelper +using TypeNameHelper::typenameHelper; template<typename T, typename = void> struct BuiltinMetaType : std::integral_constant<int, 0> |