From 796466284bf745b55ad2d15dd51f894520245888 Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 24 Jul 2020 08:48:02 -0400 Subject: 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 --- bootstrap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstrap b/bootstrap index 03d9ef0..6964683 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 template ::type = nullptr> -- cgit v0.12