From c61cedcc5475a77fb94ed12788f61039835f8079 Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Fri, 3 Jan 2020 23:06:45 +0100 Subject: GCC: revoke constexpr before 5.0 It's causing build failures on GCC 4.9 due to our code hitting https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57694 (at least since de82d239f814cf2a717bea0defeee3732384e271). Task-number: QTBUG-80997 Change-Id: I80a9d1fcbf26d8c0bf514ddc7bdb86eb7173360f Reviewed-by: Ville Voutilainen --- src/corelib/global/qcompilerdetection.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h index 0091cfcb60..1ea4e7d287 100644 --- a/src/corelib/global/qcompilerdetection.h +++ b/src/corelib/global/qcompilerdetection.h @@ -883,7 +883,6 @@ # define Q_COMPILER_DEFAULT_MEMBERS # define Q_COMPILER_DELETE_MEMBERS /* C++11 features supported in GCC 4.6: */ -# define Q_COMPILER_CONSTEXPR # define Q_COMPILER_NULLPTR # define Q_COMPILER_UNRESTRICTED_UNIONS # define Q_COMPILER_RANGE_FOR @@ -914,7 +913,11 @@ # define Q_COMPILER_REF_QUALIFIERS # endif # endif - /* C++11 features are complete as of GCC 4.8.1 */ +# if Q_CC_GNU >= 500 + /* GCC 4.6 introduces constexpr, but it's bugged (at least) in the whole + * 4.x series, see e.g. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57694 */ +# define Q_COMPILER_CONSTEXPR +# endif # endif # if __cplusplus > 201103L # if Q_CC_GNU >= 409 -- cgit v1.2.3