diff options
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/global/qnamespace.h | 8 | ||||
-rw-r--r-- | src/corelib/global/qrandom.cpp | 4 | ||||
-rw-r--r-- | src/corelib/text/qlocale_p.h | 2 | ||||
-rw-r--r-- | src/corelib/thread/qatomic_cxx11.h | 4 | ||||
-rw-r--r-- | src/corelib/thread/qbasicatomic.h | 13 | ||||
-rw-r--r-- | src/corelib/tools/qfreelist_p.h | 2 |
6 files changed, 4 insertions, 29 deletions
diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h index 157928c958..0a4f025d6a 100644 --- a/src/corelib/global/qnamespace.h +++ b/src/corelib/global/qnamespace.h @@ -1601,16 +1601,10 @@ namespace Qt { TitleBarArea // For move }; -#if defined(Q_COMPILER_CONSTEXPR) enum class Initialization { Uninitialized }; - [[maybe_unused]] static constexpr Initialization Uninitialized = Initialization::Uninitialized; -#else - enum Initialization { - Uninitialized - }; -#endif + [[maybe_unused]] static inline constexpr Initialization Uninitialized = Initialization::Uninitialized; enum CoordinateSystem { DeviceCoordinates, diff --git a/src/corelib/global/qrandom.cpp b/src/corelib/global/qrandom.cpp index b71097926c..ca16566c1c 100644 --- a/src/corelib/global/qrandom.cpp +++ b/src/corelib/global/qrandom.cpp @@ -361,15 +361,13 @@ struct QRandomGenerator::SystemAndGlobalGenerators SystemGenerator sys; alignas(64) std::aligned_storage<sizeof(QRandomGenerator64), 64>::type global_; -#ifdef Q_COMPILER_CONSTEXPR constexpr SystemAndGlobalGenerators() : globalPRNGMutex{}, system_{0}, sys{}, global_{} {} -#endif void confirmLiteral() { -#if defined(Q_COMPILER_CONSTEXPR) && !defined(Q_CC_MSVC) && !defined(Q_OS_INTEGRITY) +#if !defined(Q_CC_MSVC) && !defined(Q_OS_INTEGRITY) // Currently fails to compile with MSVC 2017, saying QBasicMutex is not // a literal type. Disassembly with MSVC 2013 and 2015 shows it is // actually a literal; MSVC 2017 has a bug relating to this, so we're diff --git a/src/corelib/text/qlocale_p.h b/src/corelib/text/qlocale_p.h index aad344eccc..69b6136313 100644 --- a/src/corelib/text/qlocale_p.h +++ b/src/corelib/text/qlocale_p.h @@ -504,7 +504,6 @@ constexpr inline bool ascii_isspace(uchar c) return c >= 1u && c <= 32u && (AsciiSpaceMask >> uint(c - 1)) & 1u; } -#if defined(Q_COMPILER_CONSTEXPR) static_assert(ascii_isspace(' ')); static_assert(ascii_isspace('\t')); static_assert(ascii_isspace('\n')); @@ -518,7 +517,6 @@ static_assert(!ascii_isspace('\177')); static_assert(!ascii_isspace(uchar('\200'))); static_assert(!ascii_isspace(uchar('\xA0'))); static_assert(!ascii_isspace(uchar('\377'))); -#endif QT_END_NAMESPACE diff --git a/src/corelib/thread/qatomic_cxx11.h b/src/corelib/thread/qatomic_cxx11.h index db78da5437..bf487bbf1f 100644 --- a/src/corelib/thread/qatomic_cxx11.h +++ b/src/corelib/thread/qatomic_cxx11.h @@ -478,11 +478,7 @@ template <typename X> struct QAtomicOps } }; -#if defined(Q_COMPILER_CONSTEXPR) # define Q_BASIC_ATOMIC_INITIALIZER(a) { a } -#else -# define Q_BASIC_ATOMIC_INITIALIZER(a) { ATOMIC_VAR_INIT(a) } -#endif QT_END_NAMESPACE diff --git a/src/corelib/thread/qbasicatomic.h b/src/corelib/thread/qbasicatomic.h index 8c6440a7d7..cb62ed2722 100644 --- a/src/corelib/thread/qbasicatomic.h +++ b/src/corelib/thread/qbasicatomic.h @@ -49,7 +49,7 @@ // If C++11 atomics are supported, use them! // Note that constexpr support is sometimes disabled in QNX or INTEGRITY builds, // but their libraries have <atomic>. -#elif defined(Q_COMPILER_ATOMICS) && (defined(Q_COMPILER_CONSTEXPR) || defined(Q_OS_QNX) || defined(Q_OS_INTEGRITY)) +#elif defined(Q_COMPILER_ATOMICS) # include <QtCore/qatomic_cxx11.h> // We only support one fallback: MSVC, because even on version 2015, it lacks full constexpr support @@ -75,16 +75,7 @@ QT_END_NAMESPACE // New atomics -#if defined(Q_COMPILER_CONSTEXPR) -# if defined(Q_CC_CLANG) && Q_CC_CLANG < 303 - /* - Do not define QT_BASIC_ATOMIC_HAS_CONSTRUCTORS for Clang before version 3.3. - For details about the bug: see http://llvm.org/bugs/show_bug.cgi?id=12670 - */ -# else -# define QT_BASIC_ATOMIC_HAS_CONSTRUCTORS -# endif -#endif +#define QT_BASIC_ATOMIC_HAS_CONSTRUCTORS template <typename T> class QBasicAtomicInteger diff --git a/src/corelib/tools/qfreelist_p.h b/src/corelib/tools/qfreelist_p.h index a90cb14cf5..f54e5aad65 100644 --- a/src/corelib/tools/qfreelist_p.h +++ b/src/corelib/tools/qfreelist_p.h @@ -207,9 +207,7 @@ public: template <typename T, typename ConstantsType> constexpr inline QFreeList<T, ConstantsType>::QFreeList() : -#if defined(Q_COMPILER_CONSTEXPR) _v{}, // uniform initialization required -#endif _next(ConstantsType::InitialNextValue) { } |