Moved fallthrough regression test to switch-implicit-fallthrough.cpp.

llvm-svn: 178554
This commit is contained in:
Alexander Kornienko 2013-04-02 17:55:01 +00:00
parent 3ca14772d0
commit 1e05e86de5
2 changed files with 18 additions and 17 deletions

View File

@ -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;
}
}
};
}

View 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;
}
}
};
}