]> granicus.if.org Git - clang/commitdiff
Don't call into objc front-end when not parsing objc code. This avoids
authorChris Lattner <sabre@nondot.org>
Fri, 9 May 2008 05:28:21 +0000 (05:28 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 9 May 2008 05:28:21 +0000 (05:28 +0000)
crashes because objc types aren't set up right.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50884 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Parse/ParseExpr.cpp

index dff7c14524a9e86bd9d6c71ff37a5263f895be62..523f6473417b3cbcff35337093a911ab362ccb78 100644 (file)
@@ -586,7 +586,9 @@ Parser::ExprResult Parser::ParseCastExpression(bool isUnaryExpression) {
   }
   case tok::l_square:
     // These can be followed by postfix-expr pieces.
-    return ParsePostfixExpressionSuffix(ParseObjCMessageExpression());
+    if (getLang().ObjC1)
+      return ParsePostfixExpressionSuffix(ParseObjCMessageExpression());
+    // FALL THROUGH.
   default:
     Diag(Tok, diag::err_expected_expression);
     return ExprResult(true);