[cfe-commits] r41243 - /cfe/trunk/Parse/ParseDecl.cpp

Chris Lattner sabre at nondot.org
Tue Aug 21 11:36:18 PDT 2007


Author: lattner
Date: Tue Aug 21 13:36:18 2007
New Revision: 41243

URL: http://llvm.org/viewvc/llvm-project?rev=41243&view=rev
Log:
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.



Modified:
    cfe/trunk/Parse/ParseDecl.cpp

Modified: cfe/trunk/Parse/ParseDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Parse/ParseDecl.cpp?rev=41243&r1=41242&r2=41243&view=diff

==============================================================================
--- cfe/trunk/Parse/ParseDecl.cpp (original)
+++ cfe/trunk/Parse/ParseDecl.cpp Tue Aug 21 13:36:18 2007
@@ -281,7 +281,7 @@
   
   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;





More information about the cfe-commits mailing list