summaryrefslogtreecommitdiff
path: root/Source/Checks
diff options
context:
space:
mode:
authorDaniel Pfeifer <daniel@pfeifer-mail.de>2017-04-22 10:09:41 +0200
committerDaniel Pfeifer <daniel@pfeifer-mail.de>2017-04-22 10:09:41 +0200
commit5d1671324bbcf0826b32c4c1691ae0f1041430ed (patch)
tree6f48e4257e0682770a83a5707efbe4fed65c3d2a /Source/Checks
parente9d1ca782ec8668681e2e88a6112af40409e5b50 (diff)
downloadcmake-5d1671324bbcf0826b32c4c1691ae0f1041430ed.tar.gz
cmConfigure: provide macros CM_EQ_DELETE and CM_DISABLE_COPY
Diffstat (limited to 'Source/Checks')
-rw-r--r--Source/Checks/cm_cxx_eq_delete.cxx14
-rw-r--r--Source/Checks/cm_cxx_features.cmake1
2 files changed, 15 insertions, 0 deletions
diff --git a/Source/Checks/cm_cxx_eq_delete.cxx b/Source/Checks/cm_cxx_eq_delete.cxx
new file mode 100644
index 0000000000..809e4cfcf3
--- /dev/null
+++ b/Source/Checks/cm_cxx_eq_delete.cxx
@@ -0,0 +1,14 @@
+struct Foo
+{
+ Foo() {}
+ ~Foo() {}
+ Foo(Foo const&) = delete;
+ Foo& operator=(Foo const&) = delete;
+ int test() const { return 0; }
+};
+
+int main()
+{
+ Foo const foo;
+ return foo.test();
+}
diff --git a/Source/Checks/cm_cxx_features.cmake b/Source/Checks/cm_cxx_features.cmake
index 80c9f3b7a7..cd58539b3c 100644
--- a/Source/Checks/cm_cxx_features.cmake
+++ b/Source/Checks/cm_cxx_features.cmake
@@ -33,6 +33,7 @@ endfunction()
if(CMAKE_CXX_STANDARD)
cm_check_cxx_feature(auto_ptr)
+ cm_check_cxx_feature(eq_delete)
cm_check_cxx_feature(make_unique)
if(CMake_HAVE_CXX_MAKE_UNIQUE)
set(CMake_HAVE_CXX_UNIQUE_PTR 1)