aboutsummaryrefslogtreecommitdiff
path: root/test/SemaCXX/switch-implicit-fallthrough.cpp
diff options
context:
space:
mode:
authorAlexander Kornienko <alexfh@google.com>2013-04-02 17:55:01 +0000
committerAlexander Kornienko <alexfh@google.com>2013-04-02 17:55:01 +0000
commit8b0822b3043f91a113d39da7aa9bb0634db69807 (patch)
tree9a32ab9e1fde61e75357f887e8ddbf96c60fa29f /test/SemaCXX/switch-implicit-fallthrough.cpp
parentcb428a1ac09dddf5ed3bf2a740f9ea31e9e11037 (diff)
Moved fallthrough regression test to switch-implicit-fallthrough.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178554 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/switch-implicit-fallthrough.cpp')
-rw-r--r--test/SemaCXX/switch-implicit-fallthrough.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/SemaCXX/switch-implicit-fallthrough.cpp b/test/SemaCXX/switch-implicit-fallthrough.cpp
index 0f7891dc53..d7959238c6 100644
--- a/test/SemaCXX/switch-implicit-fallthrough.cpp
+++ b/test/SemaCXX/switch-implicit-fallthrough.cpp
@@ -247,3 +247,21 @@ int fallthrough_targets(int n) {
}
return n;
}
+
+// Fallthrough annotations in local classes used to generate "fallthrough
+// annotation does not directly precede switch label" warning.
+void fallthrough_in_local_class() {
+ class C {
+ void f(int x) {
+ switch (x) {
+ case 0:
+ x++;
+ [[clang::fallthrough]]; // no diagnostics
+ case 1:
+ x++;
+ break;
+ }
+ }
+ };
+}
+