From 75d65600f9fd41cb88068c664e3e94bb67eebc93 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 13 Jul 2015 18:09:23 -0700 Subject: Work around ICC's bug in making std::atomic a literal type ICC 15.x and 16.0 (beta, at least) are missing the "constexpr" and "noexcept" keywords in the definition of the std::atomic constructors. The lack of constexpr makes std::atomic a non-literal type, which in turn makes QBasicAtomicInteger's constructor (which is constexpr) fail to compile. Reported as Intel issue 6000117277. Change-Id: I4a88bcca48bf0ce51557d809ef32a4545edcafee Reviewed-by: Olivier Goffart (Woboq GmbH) --- src/corelib/global/qcompilerdetection.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/corelib') diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h index a08fde8bb0..85613283f9 100644 --- a/src/corelib/global/qcompilerdetection.h +++ b/src/corelib/global/qcompilerdetection.h @@ -1023,9 +1023,15 @@ // Also disable , since it's clearly not there # undef Q_COMPILER_ATOMICS # endif -# if defined(_LIBCPP_VERSION) +# if defined(Q_CC_CLANG) && defined(Q_CC_INTEL) && Q_CC_INTEL >= 1500 +// ICC 15.x and 16.0 have their own implementation of std::atomic, which is activated when in Clang mode +// (probably because libc++'s on OS X failed to compile), but they're missing some +// critical definitions. (Reported as Intel Issue ID 6000117277) +# define __USE_CONSTEXPR 1 +# define __USE_NOEXCEPT 1 +# elif defined(_LIBCPP_VERSION) // libc++ uses __has_feature(cxx_atomic), so disable the feature if the compiler -// doesn't support it. That's required for the Intel compiler on OS X, for example. +// doesn't support it. That's required for the Intel compiler 14.x or earlier on OS X, for example. # if !__has_feature(cxx_atomic) # undef Q_COMPILER_ATOMICS # endif -- cgit v1.2.3