summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/switch-implicit-fallthrough.cpp
diff options
context:
space:
mode:
authorAlexander Kornienko <alexfh@google.com>2013-01-25 20:44:56 +0000
committerAlexander Kornienko <alexfh@google.com>2013-01-25 20:44:56 +0000
commit09f15f3edf1bd324d0eef465edd5d0bdedcb84b3 (patch)
treefd4c4d6fff278d3bfd6d6dfda891dcd3911f82b7 /clang/test/SemaCXX/switch-implicit-fallthrough.cpp
parent318cbcef91a64c433424db0941bbed74b3447e31 (diff)
downloadbcm5719-llvm-09f15f3edf1bd324d0eef465edd5d0bdedcb84b3.tar.gz
bcm5719-llvm-09f15f3edf1bd324d0eef465edd5d0bdedcb84b3.zip
Silence unintended fallthrough diagnostic on a case label preceded with a normal label.
Summary: It's unlikely that a fallthrough is unintended in the following code: switch (n) { ... label: case 1: ... goto label; ... } Reviewers: rsmith, doug.gregor Reviewed By: doug.gregor CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D329 llvm-svn: 173486
Diffstat (limited to 'clang/test/SemaCXX/switch-implicit-fallthrough.cpp')
-rw-r--r--clang/test/SemaCXX/switch-implicit-fallthrough.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/switch-implicit-fallthrough.cpp b/clang/test/SemaCXX/switch-implicit-fallthrough.cpp
index 75dda8a9617..93e724e86c6 100644
--- a/clang/test/SemaCXX/switch-implicit-fallthrough.cpp
+++ b/clang/test/SemaCXX/switch-implicit-fallthrough.cpp
@@ -38,6 +38,18 @@ int fallthrough(int n) {
case 68:
break;
}
+ switch (n / 15) {
+label_case_70:
+ case 70:
+ n += 333;
+ break;
+ case 71:
+ n += 334;
+ goto label_case_70;
+ case 72:
+ n += 335;
+ break;
+ }
switch (n / 20) {
case 7:
n += 400;
OpenPOWER on IntegriCloud