Douglas Gregor | 4186ff4 | 2010-05-20 23:20:59 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify %s |
| 2 | |
| 3 | // <rdar://problem/7971948> |
| 4 | struct A {}; |
| 5 | struct B { |
Douglas Gregor | 662a482 | 2010-12-23 22:56:40 +0000 | [diff] [blame^] | 6 | void foo(int b) { |
Douglas Gregor | 4186ff4 | 2010-05-20 23:20:59 +0000 | [diff] [blame] | 7 | switch (a) { // expected-error{{use of undeclared identifier 'a'}} |
| 8 | default: |
| 9 | return; |
| 10 | } |
Douglas Gregor | 662a482 | 2010-12-23 22:56:40 +0000 | [diff] [blame^] | 11 | |
| 12 | switch (b) { |
| 13 | case 17 // expected-error{{expected ':' after 'case'}} |
| 14 | break; |
| 15 | |
| 16 | default // expected-error{{expected ':' after 'default'}} |
| 17 | return; |
| 18 | } |
Douglas Gregor | 4186ff4 | 2010-05-20 23:20:59 +0000 | [diff] [blame] | 19 | } |
| 20 | }; |