diff options
author | Brad King <brad.king@kitware.com> | 2020-07-24 12:48:02 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-07-24 12:53:13 (GMT) |
commit | 796466284bf745b55ad2d15dd51f894520245888 (patch) | |
tree | e94d1addae6b720dd9d4d3161134dcebd5903757 /bootstrap | |
parent | e647949539f4704a00eddac2357d59ceeb8bc0ca (diff) | |
download | CMake-796466284bf745b55ad2d15dd51f894520245888.zip CMake-796466284bf745b55ad2d15dd51f894520245888.tar.gz CMake-796466284bf745b55ad2d15dd51f894520245888.tar.bz2 |
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
Diffstat (limited to 'bootstrap')
-rwxr-xr-x | bootstrap | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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> |