diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2012-04-14 14:01:31 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2012-04-14 14:01:31 +0000 |
| commit | dbe13110f59f48b4dbb7552b3ac2935acdeece7f (patch) | |
| tree | be1815eb79b42ff482a8562b13c2dcbf0c5dcbee /test/SemaCXX/switch.cpp | |
| parent | 9da628931ebf2609493570f87824ca22402cc65f (diff) | |
Notes
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 8a8cf33049d7..517faa9a696d 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}} + }(); + } +} |
