diff options
Diffstat (limited to 'test/SemaCXX/switch-implicit-fallthrough-per-method.cpp')
-rw-r--r-- | test/SemaCXX/switch-implicit-fallthrough-per-method.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/SemaCXX/switch-implicit-fallthrough-per-method.cpp b/test/SemaCXX/switch-implicit-fallthrough-per-method.cpp index 9f9f5924a0..7c52e5138b 100644 --- a/test/SemaCXX/switch-implicit-fallthrough-per-method.cpp +++ b/test/SemaCXX/switch-implicit-fallthrough-per-method.cpp @@ -37,3 +37,15 @@ int fallthrough2(int n) { } return n; } + +void unscoped(int n) { + switch (n % 2) { + case 0: + // FIXME: This should be typo-corrected, probably. + [[fallthrough]]; + case 2: // expected-warning{{unannotated fall-through}} expected-note{{clang::fallthrough}} expected-note{{break;}} + [[clang::fallthrough]]; + case 1: + break; + } +} |