summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/switch-implicit-fallthrough-per-method.cpp
diff options
context:
space:
mode:
authorAlexis Hunt <alercah@gmail.com>2012-06-18 16:13:52 +0000
committerAlexis Hunt <alercah@gmail.com>2012-06-18 16:13:52 +0000
commita0e54d453b843c424a0558cc1478b80ea3f4ab2b (patch)
tree3d242802f2a846194bf712206c5c9605ba7000a8 /clang/test/SemaCXX/switch-implicit-fallthrough-per-method.cpp
parentb7c941bad9b77d1456c2f5d01fca58dd641a5c01 (diff)
downloadbcm5719-llvm-a0e54d453b843c424a0558cc1478b80ea3f4ab2b.tar.gz
bcm5719-llvm-a0e54d453b843c424a0558cc1478b80ea3f4ab2b.zip
Handle C++11 attribute namespaces automatically.
Now, as long as the 'Namespaces' variable is correct inside Attr.td, the generated code will correctly admit a C++11 attribute only when it has the appropriate namespace(s). llvm-svn: 158661
Diffstat (limited to 'clang/test/SemaCXX/switch-implicit-fallthrough-per-method.cpp')
-rw-r--r--clang/test/SemaCXX/switch-implicit-fallthrough-per-method.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/switch-implicit-fallthrough-per-method.cpp b/clang/test/SemaCXX/switch-implicit-fallthrough-per-method.cpp
index 9f9f5924a06..7c52e5138b7 100644
--- a/clang/test/SemaCXX/switch-implicit-fallthrough-per-method.cpp
+++ b/clang/test/SemaCXX/switch-implicit-fallthrough-per-method.cpp
@@ -37,3 +37,15 @@ int fallthrough2(int n) {
}
return n;
}
+
+void unscoped(int n) {
+ switch (n % 2) {
+ case 0:
+ // FIXME: This should be typo-corrected, probably.
+ [[fallthrough]];
+ case 2: // expected-warning{{unannotated fall-through}} expected-note{{clang::fallthrough}} expected-note{{break;}}
+ [[clang::fallthrough]];
+ case 1:
+ break;
+ }
+}
OpenPOWER on IntegriCloud