mirror of
https://github.com/reactos/CMake.git
synced 2025-01-22 11:24:56 +00:00
Extend C++17/C++14 feature checks to require unique_ptr
When testing compiler modes higher than C++11 for constructs we need, include a check for using `unique_ptr` in that mode. The PGI 18.4 compiler in some environments supports `unique_ptr` in C++11 mode but is broken for C++14 and C++17. Check that `unique_ptr` works in these modes before using one.
This commit is contained in:
parent
f0e82ce9a2
commit
3a2c736b41
@ -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()
|
||||
|
@ -1,5 +1,8 @@
|
||||
#include <cstdio>
|
||||
#include <memory>
|
||||
|
||||
int main()
|
||||
{
|
||||
return 0;
|
||||
std::unique_ptr<int> u(new int(0));
|
||||
return *u;
|
||||
}
|
||||
|
@ -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()
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user