[cfe-commits] r56353 - in /cfe/trunk: lib/Parse/ParseObjc.cpp test/Parser/objc-messaging-1.m

Chris Lattner sabre at nondot.org
Fri Sep 19 10:44:00 PDT 2008


Author: lattner
Date: Fri Sep 19 12:44:00 2008
New Revision: 56353

URL: http://llvm.org/viewvc/llvm-project?rev=56353&view=rev
Log:
Fix rdar://6222856: the receiver of a message expr is an
arbitrary expr, not just a assign expr.  The grammar comment
was right, the code was just wrong.

Modified:
    cfe/trunk/lib/Parse/ParseObjc.cpp
    cfe/trunk/test/Parser/objc-messaging-1.m

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

==============================================================================
--- cfe/trunk/lib/Parse/ParseObjc.cpp (original)
+++ cfe/trunk/lib/Parse/ParseObjc.cpp Fri Sep 19 12:44:00 2008
@@ -1435,7 +1435,7 @@
     return ParseObjCMessageExpressionBody(LBracLoc, ReceiverName, 0);
   }
 
-  ExprResult Res = ParseAssignmentExpression();
+  ExprResult Res = ParseExpression();
   if (Res.isInvalid) {
     SkipUntil(tok::r_square);
     return Res;

Modified: cfe/trunk/test/Parser/objc-messaging-1.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/objc-messaging-1.m?rev=56353&r1=56352&r2=56353&view=diff

==============================================================================
--- cfe/trunk/test/Parser/objc-messaging-1.m (original)
+++ cfe/trunk/test/Parser/objc-messaging-1.m Fri Sep 19 12:44:00 2008
@@ -3,6 +3,7 @@
 {
 	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 @@
 	[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];
+
 }





More information about the cfe-commits mailing list