]> granicus.if.org Git - clang/commitdiff
Fix rdar://6222856: the receiver of a message expr is an
authorChris Lattner <sabre@nondot.org>
Fri, 19 Sep 2008 17:44:00 +0000 (17:44 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 19 Sep 2008 17:44:00 +0000 (17:44 +0000)
arbitrary expr, not just a assign expr.  The grammar comment
was right, the code was just wrong.

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

lib/Parse/ParseObjc.cpp
test/Parser/objc-messaging-1.m

index a2f4eb2508ea2844d65a121a7960282abbf3c8c4..e957db4ed9afa05764319c907c63527adad283b7 100644 (file)
@@ -1435,7 +1435,7 @@ Parser::ExprResult Parser::ParseObjCMessageExpression() {
     return ParseObjCMessageExpressionBody(LBracLoc, ReceiverName, 0);
   }
 
-  ExprResult Res = ParseAssignmentExpression();
+  ExprResult Res = ParseExpression();
   if (Res.isInvalid) {
     SkipUntil(tok::r_square);
     return Res;
index 3f6168f6b2ad4a18ef0e3c71f9e9654175486266..7340fac5f7cdc96bacc265825bd2451f556e0188 100644 (file)
@@ -3,6 +3,7 @@ int main ()
 {
        int i,j;
        struct S *p;
+        id a, b, c;
        [p ii];
        [p if: 1 :2];
        [p inout: 1 :2 another:(2,3,4)];
@@ -11,4 +12,8 @@ int main ()
        [p inout: 1 :2 another:(i+10), (i,j-1,5),6,8];
        [p long: 1 :2 another:(i+10), (i,j-1,5),6,8];
        [p : "Hello\n" :2 another:(i+10), (i,j-1,5),6,8];
+
+       // Comma expression as receiver (rdar://6222856)
+       [a, b, c foo];
+
 }