mirror of
https://github.com/llvm/llvm-project.git
synced 2025-05-02 18:46:05 +00:00

and 'default' statements, including a Fix-It to add the colon: test/Parser/switch-recovery.cpp:13:12: error: expected ':' after 'case' case 17 // expected-error{{expected ':' after 'case'}} ^ : test/Parser/switch-recovery.cpp:16:12: error: expected ':' after 'default' default // expected-error{{expected ':' after 'default'}} ^ : llvm-svn: 122522
21 lines
405 B
C++
21 lines
405 B
C++
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
|
|
|
// <rdar://problem/7971948>
|
|
struct A {};
|
|
struct B {
|
|
void foo(int b) {
|
|
switch (a) { // expected-error{{use of undeclared identifier 'a'}}
|
|
default:
|
|
return;
|
|
}
|
|
|
|
switch (b) {
|
|
case 17 // expected-error{{expected ':' after 'case'}}
|
|
break;
|
|
|
|
default // expected-error{{expected ':' after 'default'}}
|
|
return;
|
|
}
|
|
}
|
|
};
|