]> granicus.if.org Git - clang/commitdiff
Tweak error recovery for missing semicolon after decl. For this:
authorChris Lattner <sabre@nondot.org>
Tue, 21 Aug 2007 18:36:18 +0000 (18:36 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 21 Aug 2007 18:36:18 +0000 (18:36 +0000)
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

Parse/ParseDecl.cpp

index 62545634d01a073a2d67a1d27c490a6fc8f89afb..d4017bba1a978641d0f96f0dca29c6d0c421f72d 100644 (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;