2009-03-24 02:24:46 +00:00
|
|
|
// RUN: clang-cc -fsyntax-only -verify %s
|
2008-12-21 16:41:36 +00:00
|
|
|
|
|
|
|
void f()
|
|
|
|
{
|
|
|
|
try {
|
|
|
|
;
|
|
|
|
} catch(int i) {
|
|
|
|
;
|
|
|
|
} catch(...) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void g()
|
|
|
|
{
|
|
|
|
try; // expected-error {{expected '{'}}
|
|
|
|
|
|
|
|
try {}
|
|
|
|
catch; // expected-error {{expected '('}}
|
|
|
|
|
|
|
|
try {}
|
|
|
|
catch (...); // expected-error {{expected '{'}}
|
|
|
|
|
|
|
|
try {}
|
|
|
|
catch {} // expected-error {{expected '('}}
|
|
|
|
}
|
2009-04-26 20:35:05 +00:00
|
|
|
|
|
|
|
void h() try {
|
|
|
|
} catch(...) {
|
|
|
|
}
|
|
|
|
|
|
|
|
struct A {
|
|
|
|
int i;
|
|
|
|
A(float) : i(0) try {} // expected-error {{expected '{' or ','}}
|
|
|
|
A(int);
|
|
|
|
A(char);
|
|
|
|
// FIXME: There's something very strange going on here. After the first
|
|
|
|
// inline function-try-block, subsequent inline bodies aren't parsed anymore.
|
|
|
|
// Valgrind is silent, though, and I can't even debug this properly.
|
|
|
|
A() try : i(0) {} catch(...) {}
|
|
|
|
void f() try {} catch(...) {}
|
|
|
|
};
|
|
|
|
|
|
|
|
A::A(char) : i(0) try {} // expected-error {{expected '{' or ','}}
|
|
|
|
A::A(int j) try : i(j) {} catch(...) {}
|