handle the full assignment-expression grammar when using an
objc message send in an initializer expression.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51882 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Parse/ParseExpr.cpp b/lib/Parse/ParseExpr.cpp
index 523f647..4bccc38 100644
--- a/lib/Parse/ParseExpr.cpp
+++ b/lib/Parse/ParseExpr.cpp
@@ -200,6 +200,27 @@
return ParseRHSOfBinaryExpression(LHS, prec::Assignment);
}
+/// ParseAssignmentExprWithObjCMessageExprStart - Parse an assignment expression
+/// where part of an objc message send has already been parsed. In this case
+/// LBracLoc indicates the location of the '[' of the message send, and either
+/// ReceiverName or ReceiverExpr is non-null indicating the receiver of the
+/// message.
+///
+/// Since this handles full assignment-expression's, it handles postfix
+/// expressions and other binary operators for these expressions as well.
+Parser::ExprResult
+Parser::ParseAssignmentExprWithObjCMessageExprStart(SourceLocation LBracLoc,
+ IdentifierInfo *ReceiverName,
+ ExprTy *ReceiverExpr) {
+ ExprResult R = ParseObjCMessageExpressionBody(LBracLoc, ReceiverName,
+ ReceiverExpr);
+ if (R.isInvalid) return R;
+ R = ParsePostfixExpressionSuffix(R);
+ if (R.isInvalid) return R;
+ return ParseRHSOfBinaryExpression(R, 2);
+}
+
+
Parser::ExprResult Parser::ParseConstantExpression() {
ExprResult LHS = ParseCastExpression(false);
if (LHS.isInvalid) return LHS;