if (Tok.is(tok::kw_try)) {
ParseFunctionTryBlock(LM.D);
- return;
+ continue;
}
if (Tok.is(tok::colon))
ParseConstructorInitializer(LM.D);
if (Tok.is(tok::colon))
ParseConstructorInitializer(Decl);
+ SourceLocation LBraceLoc = Tok.getLocation();
OwningStmtResult FnBody(ParseCXXTryBlockCommon(TryLoc));
// If we failed to parse the try-catch, we just give the function an empty
// compound statement as the body.
if (FnBody.isInvalid())
- FnBody = Actions.ActOnCompoundStmt(TryLoc, TryLoc,
+ FnBody = Actions.ActOnCompoundStmt(LBraceLoc, LBraceLoc,
MultiStmtArg(Actions), false);
return Actions.ActOnFinishFunctionBody(Decl, move(FnBody));
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(float) : i(0) try {} // expected-error {{expected '{' or ','}}
};
A::A(char) : i(0) try {} // expected-error {{expected '{' or ','}}