[cfe-commits] r67626 - /cfe/trunk/lib/Parse/ParseExpr.cpp

Chris Lattner sabre at nondot.org
Tue Mar 24 10:21:46 PDT 2009


Author: lattner
Date: Tue Mar 24 12:21:43 2009
New Revision: 67626

URL: http://llvm.org/viewvc/llvm-project?rev=67626&view=rev
Log:
improve error recovery for when type parsing fails.

Modified:
    cfe/trunk/lib/Parse/ParseExpr.cpp

Modified: cfe/trunk/lib/Parse/ParseExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseExpr.cpp?rev=67626&r1=67625&r2=67626&view=diff

==============================================================================
--- cfe/trunk/lib/Parse/ParseExpr.cpp (original)
+++ cfe/trunk/lib/Parse/ParseExpr.cpp Tue Mar 24 12:21:43 2009
@@ -1002,7 +1002,11 @@
   case tok::kw___builtin_offsetof: {
     SourceLocation TypeLoc = Tok.getLocation();
     TypeResult Ty = ParseTypeName();
-
+    if (Ty.isInvalid()) {
+      SkipUntil(tok::r_paren);
+      return ExprError();
+    }
+    
     if (ExpectAndConsume(tok::comma, diag::err_expected_comma, "",tok::r_paren))
       return ExprError();
 





More information about the cfe-commits mailing list