summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-12-16 15:05:39 (GMT)
committerKitware Robot <kwrobot@kitware.com>2019-12-16 15:05:53 (GMT)
commita1dc0a3a22b78ea9a7ef0864dfb45ee1b3c76acc (patch)
treed2688fccf595e2c8148d093a24ec617e05009617
parent43e6254a17b180363d2fa36d2aaf56851970fb40 (diff)
parent033a4b12a5e5f67f2f00c23885a3ff04acbeb4cd (diff)
downloadCMake-a1dc0a3a22b78ea9a7ef0864dfb45ee1b3c76acc.zip
CMake-a1dc0a3a22b78ea9a7ef0864dfb45ee1b3c76acc.tar.gz
CMake-a1dc0a3a22b78ea9a7ef0864dfb45ee1b3c76acc.tar.bz2
Merge topic 'bootstrap-intel'
033a4b12a5 bootstrap: Extend C++17 check for our cast functions Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4139
-rwxr-xr-xbootstrap12
1 files changed, 11 insertions, 1 deletions
diff --git a/bootstrap b/bootstrap
index 6e89589..1b0cb26 100755
--- a/bootstrap
+++ b/bootstrap
@@ -1168,10 +1168,20 @@ int check_cxx14()
}
#endif
-#if __cplusplus >= 201703L
+#if (__cplusplus >= 201703L || defined(__INTEL_COMPILER) && defined(__cpp_if_constexpr))
#include <optional>
+template <typename T,
+ typename std::invoke_result<decltype(&T::get), T>::type = nullptr>
+typename T::pointer get_ptr(T& item)
+{
+ return item.get();
+}
+
int check_cxx17()
{
+ // Intel compiler do not handle correctly 'decltype' inside 'invoke_result'
+ std::unique_ptr<int> u(new int(0));
+ get_ptr(u);
std::optional<int> oi = 0;
return oi.value();
}