From 224d70f02a0e77d741f5b63a6e32e3b1507cd247 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Wed, 22 Oct 2014 17:58:22 +0100 Subject: [PATCH] Fix clang version checks. --- include/boost/config/compiler/clang.hpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/include/boost/config/compiler/clang.hpp b/include/boost/config/compiler/clang.hpp index 9598fd41..95ddcbef 100644 --- a/include/boost/config/compiler/clang.hpp +++ b/include/boost/config/compiler/clang.hpp @@ -233,7 +233,13 @@ // // This issue also affects C++11 mode, but C++11 constexpr requires return stmt. // Therefore we don't care such case. -#if (__clang_major__ == 3 && __clang_minor__ < 5) \ +// +// Note that we can't check Clang version directly as the numbering system changes depending who's +// creating the Clang release (see https://github.com/boostorg/config/pull/39#issuecomment-59927873) +// so instead verify that we have a feature that was introduced at the same time as working C++14 +// constexpr (generic lambda's in this case): +// +#if !__has_feature(cxx_generic_lambdas) \ || !(__has_feature(cxx_relaxed_constexpr) || __has_extension(cxx_relaxed_constexpr)) # define BOOST_NO_CXX14_CONSTEXPR #endif @@ -246,7 +252,8 @@ # define BOOST_NO_CXX14_VARIABLE_TEMPLATES #endif -#if ((__clang_major__ < 3) || (__clang_major__ == 3 && __clang_minor__ < 4)) || (__cplusplus < 201400) +#if __cplusplus < 201400 +// All versions with __cplusplus above this value seem to support this: # define BOOST_NO_CXX14_DIGIT_SEPARATORS #endif