summaryrefslogtreecommitdiff
path: root/Source/Checks
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-12-04 19:21:48 +0000
committerKitware Robot <kwrobot@kitware.com>2019-12-04 14:22:01 -0500
commite9e0e401c657c60ae7916d93321363ba22d3673a (patch)
tree2a5f818af7d3fd2c385dbaefa3f8db6a6d6ae7f1 /Source/Checks
parent816aa0740aa2e6f8b15e84c5b9bb95f7b2629847 (diff)
parentfc3b4caa2e6a1970c75830445ef4aa7d03c5a533 (diff)
downloadcmake-e9e0e401c657c60ae7916d93321363ba22d3673a.tar.gz
Merge topic 'cmext-memory'
fc3b4caa2e Memory management: cast functions for managed pointers Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4064
Diffstat (limited to 'Source/Checks')
-rw-r--r--Source/Checks/cm_cxx14_check.cmake2
-rw-r--r--Source/Checks/cm_cxx17_check.cmake2
-rw-r--r--Source/Checks/cm_cxx17_check.cpp10
3 files changed, 12 insertions, 2 deletions
diff --git a/Source/Checks/cm_cxx14_check.cmake b/Source/Checks/cm_cxx14_check.cmake
index 8e9c2c70a6..e5656bf4ed 100644
--- a/Source/Checks/cm_cxx14_check.cmake
+++ b/Source/Checks/cm_cxx14_check.cmake
@@ -1,5 +1,5 @@
set(CMake_CXX14_BROKEN 0)
-if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang|PGI")
+if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang|PGI|Intel")
if(NOT CMAKE_CXX14_STANDARD_COMPILE_OPTION)
set(CMake_CXX14_WORKS 0)
endif()
diff --git a/Source/Checks/cm_cxx17_check.cmake b/Source/Checks/cm_cxx17_check.cmake
index 9e1d9c3eae..dba3eaf3b3 100644
--- a/Source/Checks/cm_cxx17_check.cmake
+++ b/Source/Checks/cm_cxx17_check.cmake
@@ -1,5 +1,5 @@
set(CMake_CXX17_BROKEN 0)
-if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang|PGI")
+if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang|PGI|Intel")
if(NOT CMAKE_CXX17_STANDARD_COMPILE_OPTION)
set(CMake_CXX17_WORKS 0)
endif()
diff --git a/Source/Checks/cm_cxx17_check.cpp b/Source/Checks/cm_cxx17_check.cpp
index 29863b136b..abbe22cf6f 100644
--- a/Source/Checks/cm_cxx17_check.cpp
+++ b/Source/Checks/cm_cxx17_check.cpp
@@ -8,6 +8,13 @@
# include <comdef.h>
#endif
+template <typename T,
+ typename std::invoke_result<decltype(&T::get), T>::type = nullptr>
+typename T::pointer get_ptr(T& item)
+{
+ return item.get();
+}
+
int main()
{
int a[] = { 0, 1, 2 };
@@ -20,6 +27,9 @@ int main()
std::unique_ptr<int> u(new int(0));
+ // Intel compiler do not handle correctly 'decltype' inside 'invoke_result'
+ get_ptr(u);
+
#ifdef _MSC_VER
// clang-cl has problems instantiating this constructor in C++17 mode
// error: indirection requires pointer operand ('const _GUID' invalid)