From 43ba25187b516cde02aa0f31972d1145625f75df Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 21 Aug 2007 18:36:18 +0000 Subject: [PATCH] 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 --- clang/Parse/ParseDecl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang/Parse/ParseDecl.cpp b/clang/Parse/ParseDecl.cpp index 62545634d01a..d4017bba1a97 100644 --- a/clang/Parse/ParseDecl.cpp +++ b/clang/Parse/ParseDecl.cpp @@ -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;