summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-08-06 12:19:33 (GMT)
committerKitware Robot <kwrobot@kitware.com>2018-08-06 12:19:40 (GMT)
commit117d9f557042aa3a178e059cb038eaf0cb399b0a (patch)
treeb662d93ef04c41d95dd0b4618b53e5b23725477c /Source
parente19453d8ec91d7694ceb4729d68574ccd183476e (diff)
parent3a2c736b41fb394b389607b0ccf96611c42319f5 (diff)
downloadCMake-117d9f557042aa3a178e059cb038eaf0cb399b0a.zip
CMake-117d9f557042aa3a178e059cb038eaf0cb399b0a.tar.gz
CMake-117d9f557042aa3a178e059cb038eaf0cb399b0a.tar.bz2
Merge topic 'check-unique_ptr-pgi'
3a2c736b41 Extend C++17/C++14 feature checks to require unique_ptr Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2252
Diffstat (limited to 'Source')
-rw-r--r--Source/Checks/cm_cxx14_check.cmake2
-rw-r--r--Source/Checks/cm_cxx14_check.cpp5
-rw-r--r--Source/Checks/cm_cxx17_check.cmake2
-rw-r--r--Source/Checks/cm_cxx17_check.cpp4
4 files changed, 9 insertions, 4 deletions
diff --git a/Source/Checks/cm_cxx14_check.cmake b/Source/Checks/cm_cxx14_check.cmake
index a78ba35..38606b9 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")
+if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang|PGI")
if(NOT CMAKE_CXX14_STANDARD_COMPILE_OPTION)
set(CMake_CXX14_WORKS 0)
endif()
diff --git a/Source/Checks/cm_cxx14_check.cpp b/Source/Checks/cm_cxx14_check.cpp
index f5806a9..9369ba2 100644
--- a/Source/Checks/cm_cxx14_check.cpp
+++ b/Source/Checks/cm_cxx14_check.cpp
@@ -1,5 +1,8 @@
#include <cstdio>
+#include <memory>
+
int main()
{
- return 0;
+ std::unique_ptr<int> u(new int(0));
+ return *u;
}
diff --git a/Source/Checks/cm_cxx17_check.cmake b/Source/Checks/cm_cxx17_check.cmake
index 83d3971..4da2fd7 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")
+if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang|PGI")
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 2cbf1d5..4e89184 100644
--- a/Source/Checks/cm_cxx17_check.cpp
+++ b/Source/Checks/cm_cxx17_check.cpp
@@ -1,7 +1,9 @@
#include <cstdio>
+#include <memory>
#include <unordered_map>
int main()
{
- return 0;
+ std::unique_ptr<int> u(new int(0));
+ return *u;
}