summaryrefslogtreecommitdiff
path: root/Source/Checks/cm_cxx_gnu_fallthrough.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Checks/cm_cxx_gnu_fallthrough.cxx')
-rw-r--r--Source/Checks/cm_cxx_gnu_fallthrough.cxx11
1 files changed, 11 insertions, 0 deletions
diff --git a/Source/Checks/cm_cxx_gnu_fallthrough.cxx b/Source/Checks/cm_cxx_gnu_fallthrough.cxx
new file mode 100644
index 0000000000..6021094053
--- /dev/null
+++ b/Source/Checks/cm_cxx_gnu_fallthrough.cxx
@@ -0,0 +1,11 @@
+int main(int argc, char* argv[])
+{
+ int i = 3;
+ switch (argc) {
+ case 1:
+ i = 0;
+ [[gnu::fallthrough]];
+ default:
+ return i;
+ }
+}