From: Chris Lattner Date: Tue, 21 Aug 2007 18:36:18 +0000 (+0000) Subject: Tweak error recovery for missing semicolon after decl. For this: X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ed442385459a68560c61ef826a9475688d18658b;p=clang 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41243 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/Parse/ParseDecl.cpp b/Parse/ParseDecl.cpp index 62545634d0..d4017bba1a 100644 --- a/Parse/ParseDecl.cpp +++ b/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;