summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-07-24 08:48:02 -0400
committerBrad King <brad.king@kitware.com>2020-07-24 08:53:13 -0400
commit796466284bf745b55ad2d15dd51f894520245888 (patch)
treee94d1addae6b720dd9d4d3161134dcebd5903757
parente647949539f4704a00eddac2357d59ceeb8bc0ca (diff)
downloadcmake-796466284bf745b55ad2d15dd51f894520245888.tar.gz
bootstrap: Fix support for Intel compiler with modern GNU system compiler
On systems with older GNU system compilers, the Intel C++ compiler does not define `__cplusplus` to any version newer than C++11. This prevented `bootstrap` from detecting that a given C++ standard flag has enabled C++17 mode in the compiler. In commit 033a4b12a5 (bootstrap: Extend C++17 check for our cast functions, 2019-12-14, v3.17.0-rc1~291^2) we added a preprocessor condition to attempt to detect C++17 mode in the Intel compiler on such systems by looking for `__cpp_if_constexpr`. However, on systems with a modern GNU system compiler, that definition is available even in C++11 mode. Switch to using `__cpp_deduction_guides` to detect C++17 mode for the Intel C++ compiler. That seems to be defined exclusively in C++17 mode regardless of the version of the system compiler. Fixes: #21013
-rwxr-xr-xbootstrap2
1 files changed, 1 insertions, 1 deletions
diff --git a/bootstrap b/bootstrap
index 03d9ef0df9..69646837f9 100755
--- a/bootstrap
+++ b/bootstrap
@@ -1168,7 +1168,7 @@ int check_cxx14()
}
#endif
-#if (__cplusplus >= 201703L || defined(__INTEL_COMPILER) && defined(__cpp_if_constexpr))
+#if (__cplusplus >= 201703L || defined(__INTEL_COMPILER) && defined(__cpp_deduction_guides))
#include <optional>
template <typename T,
typename std::invoke_result<decltype(&T::get), T>::type = nullptr>