diff options
author | Alexander Kornienko <alexfh@google.com> | 2013-04-02 17:55:01 +0000 |
---|---|---|
committer | Alexander Kornienko <alexfh@google.com> | 2013-04-02 17:55:01 +0000 |
commit | 1e05e86de5ee43bbaba661e7c5576c1c5a4ff338 (patch) | |
tree | 2de48e4020330b1858f28595b14bb6718571650d /clang/test/SemaCXX/switch-implicit-fallthrough.cpp | |
parent | 3ca14772d0c3d50e5b8b32fd405ebc0b571d1ab2 (diff) | |
download | bcm5719-llvm-1e05e86de5ee43bbaba661e7c5576c1c5a4ff338.tar.gz bcm5719-llvm-1e05e86de5ee43bbaba661e7c5576c1c5a4ff338.zip |
Moved fallthrough regression test to switch-implicit-fallthrough.cpp.
llvm-svn: 178554
Diffstat (limited to 'clang/test/SemaCXX/switch-implicit-fallthrough.cpp')
-rw-r--r-- | clang/test/SemaCXX/switch-implicit-fallthrough.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/switch-implicit-fallthrough.cpp b/clang/test/SemaCXX/switch-implicit-fallthrough.cpp index 0f7891dc53c..d7959238c6b 100644 --- a/clang/test/SemaCXX/switch-implicit-fallthrough.cpp +++ b/clang/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; + } + } + }; +} + |