]> granicus.if.org Git - clang/commitdiff
Moved fallthrough regression test to switch-implicit-fallthrough.cpp.
authorAlexander Kornienko <alexfh@google.com>
Tue, 2 Apr 2013 17:55:01 +0000 (17:55 +0000)
committerAlexander Kornienko <alexfh@google.com>
Tue, 2 Apr 2013 17:55:01 +0000 (17:55 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178554 91177308-0d34-0410-b5e6-96231b3b80d8

test/SemaCXX/switch-implicit-fallthrough-regression.cpp [deleted file]
test/SemaCXX/switch-implicit-fallthrough.cpp

diff --git a/test/SemaCXX/switch-implicit-fallthrough-regression.cpp b/test/SemaCXX/switch-implicit-fallthrough-regression.cpp
deleted file mode 100644 (file)
index aec3769..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-// 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;
-      }
-    }
-  };
-}
-
index 0f7891dc53c347bbc63b0a50b61a2e6dae5d2ecd..d7959238c6b3612919432746df03295047767bd5 100644 (file)
@@ -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;
+      }
+    }
+  };
+}
+