forked from OSchip/llvm-project
The mysterious bug turns out to be an incredibly bone-headed mistake.
llvm-svn: 70160
This commit is contained in:
parent
0d0d3e56dd
commit
d98ecd615f
|
@ -145,7 +145,7 @@ void Parser::ParseLexedMethodDefs() {
|
|||
|
||||
if (Tok.is(tok::kw_try)) {
|
||||
ParseFunctionTryBlock(LM.D);
|
||||
return;
|
||||
continue;
|
||||
}
|
||||
if (Tok.is(tok::colon))
|
||||
ParseConstructorInitializer(LM.D);
|
||||
|
|
|
@ -1324,11 +1324,12 @@ Parser::DeclPtrTy Parser::ParseFunctionTryBlock(DeclPtrTy Decl) {
|
|||
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));
|
||||
|
|
|
@ -30,14 +30,11 @@ void h() try {
|
|||
|
||||
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 ','}}
|
||||
|
|
Loading…
Reference in New Issue