diff options
author | Sean Hunt <scshunt@csclub.uwaterloo.ca> | 2012-06-18 16:13:52 +0000 |
---|---|---|
committer | Sean Hunt <scshunt@csclub.uwaterloo.ca> | 2012-06-18 16:13:52 +0000 |
commit | 93f95f2a2cbb6bb3d17bfb5fc74ce1cccea751b6 (patch) | |
tree | 8240d49bcf20127ffff2af2652d8e4f29b147588 /test/SemaCXX/switch-implicit-fallthrough-per-method.cpp | |
parent | adc6cbf5b502f1b58078455ab4fca66c7daac239 (diff) |
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).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158661 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/switch-implicit-fallthrough-per-method.cpp')
-rw-r--r-- | test/SemaCXX/switch-implicit-fallthrough-per-method.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/SemaCXX/switch-implicit-fallthrough-per-method.cpp b/test/SemaCXX/switch-implicit-fallthrough-per-method.cpp index 9f9f5924a0..7c52e5138b 100644 --- a/test/SemaCXX/switch-implicit-fallthrough-per-method.cpp +++ b/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; + } +} |