From 357f80878d56d9b612724533fa7ad9d25c7ec100 Mon Sep 17 00:00:00 2001 From: Adam Majer Date: Fri, 5 Sep 2014 15:30:49 -0500 Subject: Bump Q_COMPILER_INITIALIZER_LISTS to GCC 4.5 While GCC 4.4 has the required header, it is missing important typedefs requiring use of pointers instead. This is acceptable if only used in one or two places, but a quick search through the source code lists quite a few usages of const_iterator typedef. $ git grep -c initializer_list\<.\*\>::const_iterator src/corelib/global/qflags.h:2 src/corelib/json/qjsonarray.h:1 src/corelib/json/qjsonobject.h:1 src/corelib/tools/qhash.h:2 src/corelib/tools/qmap.h:2 src/corelib/tools/qset.h:1 The lesser-evil is to bump Q_COMPILER_INITIALIZER_LISTS to version GCC 4.5 and retain usage of required (by standard) initializer_list typedefs. Change-Id: I38d6fa0ef3dc7d958587b406d33e3e3a7378c026 Reviewed-by: Thiago Macieira --- src/corelib/global/qcompilerdetection.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h index 3bf1cc0cbb..2c7a00133d 100644 --- a/src/corelib/global/qcompilerdetection.h +++ b/src/corelib/global/qcompilerdetection.h @@ -742,7 +742,6 @@ # define Q_COMPILER_DEFAULT_MEMBERS # define Q_COMPILER_DELETE_MEMBERS # define Q_COMPILER_EXTERN_TEMPLATES -# define Q_COMPILER_INITIALIZER_LISTS # define Q_COMPILER_UNIFORM_INIT # define Q_COMPILER_UNICODE_STRINGS # define Q_COMPILER_VARIADIC_TEMPLATES @@ -750,6 +749,9 @@ # if (__GNUC__ * 100 + __GNUC_MINOR__) >= 405 /* C++11 features supported in GCC 4.5: */ # define Q_COMPILER_EXPLICIT_CONVERSIONS + /* GCC 4.4 implements initializer_list but does not define typedefs required + * by the standard. */ +# define Q_COMPILER_INITIALIZER_LISTS # define Q_COMPILER_LAMBDA # define Q_COMPILER_RAW_STRINGS # endif -- cgit v1.2.3