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

clattner at cs.uiuc.edu clattner at cs.uiuc.edu
Wed Jul 11 09:44:10 PDT 2007


Author: clattner
Date: Wed Jul 11 11:44:10 2007
New Revision: 39420

URL: http://llvm.org/viewvc/llvm-project?rev=39420&view=rev
Log:
Fix an error recovery bug, we were would issue:

enum {
        CSSM_FALSE = 0,
        CSSM_TRUE = !&CSSM_FALSE
};

t.c:4:15: error: invalid lvalue in address expression
        CSSM_TRUE = !&CSSM_FALSE
                     ^
t.c:6:2: error: expected '}'
};
 ^
t.c:2:6: error: to match this '{'
enum {
     ^
3 diagnostics generated.



We now issue:
t.c:4:15: error: invalid lvalue in address expression
        CSSM_TRUE = !&CSSM_FALSE
                     ^
1 diagnostics generated.

Modified:
    cfe/cfe/trunk/Parse/ParseDecl.cpp

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

==============================================================================
--- cfe/cfe/trunk/Parse/ParseDecl.cpp (original)
+++ cfe/cfe/trunk/Parse/ParseDecl.cpp Wed Jul 11 11:44:10 2007
@@ -646,7 +646,7 @@
       EqualLoc = ConsumeToken();
       ExprResult Res = ParseConstantExpression();
       if (Res.isInvalid)
-        SkipUntil(tok::comma, true, false);
+        SkipUntil(tok::comma, tok::r_brace, true, true);
       else
         AssignedVal = Res.Val;
     }





More information about the cfe-commits mailing list