From fb046c932f0d1c54a2baf3633de26926c939082b Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 9 Jun 2017 14:46:01 -0700 Subject: 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 Reviewed-by: Thiago Macieira --- src/corelib/tools/qfreelist_p.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/corelib/tools/qfreelist_p.h') 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 Q_DECL_CONSTEXPR inline QFreeList::QFreeList() - : _next(ConstantsType::InitialNextValue) + : +#if defined(Q_COMPILER_CONSTEXPR) + _v{}, // uniform initialization required +#endif + _next(ConstantsType::InitialNextValue) { } template -- cgit v1.2.3