forked from OSchip/llvm-project
Tweak error recovery for missing semicolon after decl. For this:
void foo() { int x if (x) { } } We now emit: a.c:5:3: error: parse error if (x) { ^ 1 diagnostic generated. instead of: a.c:5:3: error: parse error if (x) { ^ a.c:9:1: error: expected '}' ^ 2 diagnostics generated. llvm-svn: 41243
This commit is contained in:
parent
592d757c92
commit
43ba25187b
|
@ -281,7 +281,7 @@ ParseInitDeclaratorListAfterFirstDeclarator(Declarator &D) {
|
|||
|
||||
Diag(Tok, diag::err_parse_error);
|
||||
// Skip to end of block or statement
|
||||
SkipUntil(tok::r_brace, true);
|
||||
SkipUntil(tok::r_brace, true, true);
|
||||
if (Tok.getKind() == tok::semi)
|
||||
ConsumeToken();
|
||||
return 0;
|
||||
|
|
Loading…
Reference in New Issue