summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2017-06-09 14:46:01 -0700
committerThiago Macieira <thiago.macieira@intel.com>2017-07-03 16:01:07 +0000
commitfb046c932f0d1c54a2baf3633de26926c939082b (patch)
tree5814260c5d70589a287033a9c7bca988d5f41a2f /src/corelib/tools
parentd3590d32a53c90fec6596bd8f443c8a6f55d2bef (diff)
Fix build with MSVC 2015 Update 2 if constexpr is enabled
This compiler seems to require explicit initialization of all member variables in a constexpr constructor, even if they have an implicit default constructor of their own. We probably fixed the rest of Qt a couple of years ago, but not these two places because they were arrays and those require the C++11 syntax for uniform initialization. All compilers that support constexpr do support uniform initialization. MSVC 2015 fixed our issues with it on the same update. Change-Id: Ibc1eb23e3ae093f5c6928ded3a041be35eb9baae Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/tools')
-rw-r--r--src/corelib/tools/qfreelist_p.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/corelib/tools/qfreelist_p.h b/src/corelib/tools/qfreelist_p.h
index a8d1132d06..2f98cf5cc1 100644
--- a/src/corelib/tools/qfreelist_p.h
+++ b/src/corelib/tools/qfreelist_p.h
@@ -207,7 +207,11 @@ public:
template <typename T, typename ConstantsType>
Q_DECL_CONSTEXPR inline QFreeList<T, ConstantsType>::QFreeList()
- : _next(ConstantsType::InitialNextValue)
+ :
+#if defined(Q_COMPILER_CONSTEXPR)
+ _v{}, // uniform initialization required
+#endif
+ _next(ConstantsType::InitialNextValue)
{ }
template <typename T, typename ConstantsType>