forked from OSchip/llvm-project
Fix <rdar://problem/6764172> [sema] crash on invalid.
llvm-svn: 68568
This commit is contained in:
parent
ea10ab668f
commit
65a0089eb7
|
@ -1294,8 +1294,14 @@ Parser::OwningStmtResult Parser::ParseObjCTryStmt(SourceLocation atLoc) {
|
|||
FirstPart = Actions.ActOnParamDeclarator(CurScope, ParmDecl);
|
||||
} else
|
||||
ConsumeToken(); // consume '...'
|
||||
SourceLocation RParenLoc = ConsumeParen();
|
||||
|
||||
SourceLocation RParenLoc;
|
||||
|
||||
if (Tok.is(tok::r_paren))
|
||||
RParenLoc = ConsumeParen();
|
||||
else // Skip over garbage, until we get to ')'. Eat the ')'.
|
||||
SkipUntil(tok::r_paren, true, false);
|
||||
|
||||
OwningStmtResult CatchBody(Actions, true);
|
||||
if (Tok.is(tok::l_brace))
|
||||
CatchBody = ParseCompoundStatementBody();
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
// RUN: clang-cc %s -verify -fsyntax-only
|
||||
|
||||
// Note: NSException is not declared.
|
||||
void f0(id x) {
|
||||
@try {
|
||||
} @catch (NSException *x) { // expected-warning{{type specifier missing, defaults to 'int'}} expected-error{{@catch parameter is not an Objective-C class type}}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue