aboutsummaryrefslogtreecommitdiff
path: root/test/SemaCXX/switch-implicit-fallthrough-regression.cpp
diff options
context:
space:
mode:
authorAlexander Kornienko <alexfh@google.com>2013-04-02 15:20:32 +0000
committerAlexander Kornienko <alexfh@google.com>2013-04-02 15:20:32 +0000
commitb0707c9a933b1839fa966e4c72e4dcb9a198f11f (patch)
tree037e937a7524cae3999c6626e44a9dafaa6f0be7 /test/SemaCXX/switch-implicit-fallthrough-regression.cpp
parent3791130df5ad83e4a9872f90cc9675e90b772f88 (diff)
Fixed "fallthrough annotation does not directly precede switch label" warning in
case when [[clang::fallthrough]]; is used in a method of a local class. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178543 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/switch-implicit-fallthrough-regression.cpp')
-rw-r--r--test/SemaCXX/switch-implicit-fallthrough-regression.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/SemaCXX/switch-implicit-fallthrough-regression.cpp b/test/SemaCXX/switch-implicit-fallthrough-regression.cpp
new file mode 100644
index 0000000000..aec3769e00
--- /dev/null
+++ b/test/SemaCXX/switch-implicit-fallthrough-regression.cpp
@@ -0,0 +1,17 @@
+// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 -Wimplicit-fallthrough %s
+
+void f() {
+ class C {
+ void f(int x) {
+ switch (x) {
+ case 0:
+ x++;
+ [[clang::fallthrough]]; // expected-no-diagnostics
+ case 1:
+ x++;
+ break;
+ }
+ }
+ };
+}
+