summaryrefslogtreecommitdiffstats
path: root/src/corelib/global
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-11-17 13:24:46 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-11-17 21:28:11 +0100
commit34304e3100883187ca658b8c983af21549496b43 (patch)
tree5c2e8216740e4ad4e9efc6010539c3a6cfbbbf8e /src/corelib/global
parent1e9dc3ec2f254c711149f8c0376f0403df9b4650 (diff)
Get rid of Q_COMPILER_CONSTEXPR checks
Is required now. Change-Id: I62e95929d1649ea1390392230b619bd56d2a0349 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/corelib/global')
-rw-r--r--src/corelib/global/qnamespace.h8
-rw-r--r--src/corelib/global/qrandom.cpp4
2 files changed, 2 insertions, 10 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