diff options
author | dim <dim@FreeBSD.org> | 2012-04-14 14:01:31 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2012-04-14 14:01:31 +0000 |
commit | 50b73317314e889cf39c7b1d6cbf419fa7502f22 (patch) | |
tree | be1815eb79b42ff482a8562b13c2dcbf0c5dcbee /test/SemaCXX/switch.cpp | |
parent | dc04cb328508e61aad809d9b53b12f9799a00e7d (diff) | |
download | FreeBSD-src-50b73317314e889cf39c7b1d6cbf419fa7502f22.zip FreeBSD-src-50b73317314e889cf39c7b1d6cbf419fa7502f22.tar.gz |
Vendor import of clang trunk r154661:
http://llvm.org/svn/llvm-project/cfe/trunk@r154661
Diffstat (limited to 'test/SemaCXX/switch.cpp')
-rw-r--r-- | test/SemaCXX/switch.cpp | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/test/SemaCXX/switch.cpp b/test/SemaCXX/switch.cpp index 8a8cf33..517faa9 100644 --- a/test/SemaCXX/switch.cpp +++ b/test/SemaCXX/switch.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fsyntax-only -verify -Wswitch-enum %s +// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s void test() { bool x = true; @@ -64,3 +64,24 @@ void click_check_header_sizes() { case 0: ; } } + +void local_class(int n) { + for (;;) switch (n) { + case 0: + struct S { + void f() { + case 1: // expected-error {{'case' statement not in switch statement}} + break; // expected-error {{'break' statement not in loop or switch statement}} + default: // expected-error {{'default' statement not in switch statement}} + continue; // expected-error {{'continue' statement not in loop statement}} + } + }; + S().f(); + []{ + case 2: // expected-error {{'case' statement not in switch statement}} + break; // expected-error {{'break' statement not in loop or switch statement}} + default: // expected-error {{'default' statement not in switch statement}} + continue; // expected-error {{'continue' statement not in loop statement}} + }(); + } +} |