diff --git a/src/corelib/kernel/qapplicationstatic.h b/src/corelib/kernel/qapplicationstatic.h index d2e050a911f..f311da5d77e 100644 --- a/src/corelib/kernel/qapplicationstatic.h +++ b/src/corelib/kernel/qapplicationstatic.h @@ -17,7 +17,7 @@ template struct ApplicationHolder using Type = typename QAS::QAS_Type; using PlainType = std::remove_cv_t; - Q_CONSTINIT static inline std::aligned_union_t<1, PlainType> storage = {}; + Q_CONSTINIT static inline struct { alignas(Type) unsigned char data[sizeof(Type)]; } storage = {}; Q_CONSTINIT static inline QBasicAtomicInteger guard = { QtGlobalStatic::Uninitialized }; Q_CONSTINIT static inline QBasicMutex mutex {};