QRandom: enable a check also on MSVC

We require MSVC 2019 these days, so we can actually check for
constexpr initialization.

Change-Id: Idc14b785d51c8baaa0bca0ec7dd2e8a85a7e2092
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Giuseppe D'Angelo 2021-05-01 17:00:02 +02:00
parent 6351b5433d
commit 6ab8ea2d58

View File

@ -368,13 +368,8 @@ struct QRandomGenerator::SystemAndGlobalGenerators
void confirmLiteral()
{
#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
// withhold judgement for now. Integrity's compiler is unable to
// guarantee g's alignment for some reason.
#if !defined(Q_OS_INTEGRITY)
// Integrity's compiler is unable to guarantee g's alignment for some reason.
constexpr SystemAndGlobalGenerators g = {};
Q_UNUSED(g);
#endif