summaryrefslogtreecommitdiff
path: root/Source/Checks
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-11-30 08:58:01 -0500
committerBrad King <brad.king@kitware.com>2017-11-30 09:50:39 -0500
commitb2f612a0fabfb87e79b60f440c05a2cecde424f0 (patch)
treeac6526de6f5a6aa2d1dcf679178fd29abb184929 /Source/Checks
parentd094b6796a3d9ee91a00f9541416e5d1e9304da8 (diff)
downloadcmake-b2f612a0fabfb87e79b60f440c05a2cecde424f0.tar.gz
Simplify CM_FALLTHROUGH implementation
Use the macro now provided by KWSys instead of using `try_compile` checks. It will no longer consider the `__attribute__((fallthrough))` variant, but compilers that don't have one of the modern attributes shouldn't warn about not using one anyway.
Diffstat (limited to 'Source/Checks')
-rw-r--r--Source/Checks/cm_cxx_attribute_fallthrough.cxx11
-rw-r--r--Source/Checks/cm_cxx_fallthrough.cxx11
-rw-r--r--Source/Checks/cm_cxx_features.cmake7
-rw-r--r--Source/Checks/cm_cxx_gnu_fallthrough.cxx11
4 files changed, 0 insertions, 40 deletions
diff --git a/Source/Checks/cm_cxx_attribute_fallthrough.cxx b/Source/Checks/cm_cxx_attribute_fallthrough.cxx
deleted file mode 100644
index 50605b70a5..0000000000
--- a/Source/Checks/cm_cxx_attribute_fallthrough.cxx
+++ /dev/null
@@ -1,11 +0,0 @@
-int main(int argc, char* [])
-{
- int i = 3;
- switch (argc) {
- case 1:
- i = 0;
- __attribute__((fallthrough));
- default:
- return i;
- }
-}
diff --git a/Source/Checks/cm_cxx_fallthrough.cxx b/Source/Checks/cm_cxx_fallthrough.cxx
deleted file mode 100644
index 2825bed1e9..0000000000
--- a/Source/Checks/cm_cxx_fallthrough.cxx
+++ /dev/null
@@ -1,11 +0,0 @@
-int main(int argc, char* [])
-{
- int i = 3;
- switch (argc) {
- case 1:
- i = 0;
- [[fallthrough]];
- default:
- return i;
- }
-}
diff --git a/Source/Checks/cm_cxx_features.cmake b/Source/Checks/cm_cxx_features.cmake
index a30a5e6900..2704c4032a 100644
--- a/Source/Checks/cm_cxx_features.cmake
+++ b/Source/Checks/cm_cxx_features.cmake
@@ -41,13 +41,6 @@ function(cm_check_cxx_feature name)
endif()
endfunction()
-cm_check_cxx_feature(fallthrough)
-if(NOT CMake_HAVE_CXX_FALLTHROUGH)
- cm_check_cxx_feature(gnu_fallthrough)
- if(NOT CMake_HAVE_CXX_GNU_FALLTHROUGH)
- cm_check_cxx_feature(attribute_fallthrough)
- endif()
-endif()
cm_check_cxx_feature(make_unique)
if(CMake_HAVE_CXX_MAKE_UNIQUE)
set(CMake_HAVE_CXX_UNIQUE_PTR 1)
diff --git a/Source/Checks/cm_cxx_gnu_fallthrough.cxx b/Source/Checks/cm_cxx_gnu_fallthrough.cxx
deleted file mode 100644
index ebc15f4319..0000000000
--- a/Source/Checks/cm_cxx_gnu_fallthrough.cxx
+++ /dev/null
@@ -1,11 +0,0 @@
-int main(int argc, char* [])
-{
- int i = 3;
- switch (argc) {
- case 1:
- i = 0;
- [[gnu::fallthrough]];
- default:
- return i;
- }
-}