summaryrefslogtreecommitdiff
path: root/Source/Checks/cm_cxx_fallthrough.cxx
diff options
context:
space:
mode:
authorDaniel Pfeifer <daniel@pfeifer-mail.de>2017-06-02 20:32:58 +0200
committerDaniel Pfeifer <daniel@pfeifer-mail.de>2017-06-03 08:38:51 +0200
commit8d7b3ef5d42c07dffe1f84af14b0055d288e4376 (patch)
tree5b7a772ab56138a24ada6c3a103e5c37863be32b /Source/Checks/cm_cxx_fallthrough.cxx
parent0068224fdd7569f02dffe9fd8de2e6ce0c7abc28 (diff)
downloadcmake-8d7b3ef5d42c07dffe1f84af14b0055d288e4376.tar.gz
Provide and use CM_FALLTHROUGH
Diffstat (limited to 'Source/Checks/cm_cxx_fallthrough.cxx')
-rw-r--r--Source/Checks/cm_cxx_fallthrough.cxx11
1 files changed, 11 insertions, 0 deletions
diff --git a/Source/Checks/cm_cxx_fallthrough.cxx b/Source/Checks/cm_cxx_fallthrough.cxx
new file mode 100644
index 0000000000..7b35a5f29a
--- /dev/null
+++ b/Source/Checks/cm_cxx_fallthrough.cxx
@@ -0,0 +1,11 @@
+int main(int argc, char* argv[])
+{
+ int i = 3;
+ switch (argc) {
+ case 1:
+ i = 0;
+ [[fallthrough]];
+ default:
+ return i;
+ }
+}