summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/corelib/global/qglobal.h9
-rw-r--r--src/corelib/kernel/qobject.cpp2
-rw-r--r--src/corelib/kernel/qproperty.cpp2
3 files changed, 5 insertions, 8 deletions
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
index 982cb4bf34..d1207498af 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -895,10 +895,11 @@ constexpr std::underlying_type_t<Enum> qToUnderlying(Enum e) noexcept
#endif
#ifdef __cpp_constinit
-# define Q_CONSTINIT constinit
# if defined(Q_CC_MSVC) && !defined(Q_CC_CLANG)
// https://developercommunity.visualstudio.com/t/C:-constinit-for-an-optional-fails-if-/1406069
-# define Q_THREAD_LOCAL_CONSTINIT
+# define Q_CONSTINIT
+# else
+# define Q_CONSTINIT constinit
# endif
#elif defined(__has_cpp_attribute) && __has_cpp_attribute(clang::require_constant_initialization)
# define Q_CONSTINIT [[clang::require_constant_initialization]]
@@ -908,10 +909,6 @@ constexpr std::underlying_type_t<Enum> qToUnderlying(Enum e) noexcept
# define Q_CONSTINIT
#endif
-#ifndef Q_THREAD_LOCAL_CONSTINIT
-# define Q_THREAD_LOCAL_CONSTINIT Q_CONSTINIT
-#endif
-
template <typename T> inline T *qGetPtrHelper(T *ptr) noexcept { return ptr; }
template <typename Ptr> inline auto qGetPtrHelper(Ptr &ptr) noexcept -> decltype(ptr.get())
{ static_assert(noexcept(ptr.get()), "Smart d pointers for Q_DECLARE_PRIVATE must have noexcept get()"); return ptr.get(); }
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp
index e07631d001..a7f48b5c59 100644
--- a/src/corelib/kernel/qobject.cpp
+++ b/src/corelib/kernel/qobject.cpp
@@ -2415,7 +2415,7 @@ public:
{ return std::find(locations.begin(), locations.end(), method) != locations.end(); }
};
-Q_THREAD_LOCAL_CONSTINIT static thread_local FlaggedDebugSignatures flaggedSignatures = {};
+Q_CONSTINIT static thread_local FlaggedDebugSignatures flaggedSignatures = {};
} // unnamed namespace
const char *qFlagLocation(const char *method)
diff --git a/src/corelib/kernel/qproperty.cpp b/src/corelib/kernel/qproperty.cpp
index f80c22c0d9..a6435830f9 100644
--- a/src/corelib/kernel/qproperty.cpp
+++ b/src/corelib/kernel/qproperty.cpp
@@ -164,7 +164,7 @@ struct QPropertyDelayedNotifications
}
};
-Q_THREAD_LOCAL_CONSTINIT static thread_local QBindingStatus bindingStatus;
+Q_CONSTINIT static thread_local QBindingStatus bindingStatus;
/*!
\since 6.2