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:
Chris Lattner 2007-08-21 18:36:18 +00:00
parent 592d757c92
commit 43ba25187b
1 changed files with 1 additions and 1 deletions

View File

@ -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;