]> granicus.if.org Git - clang/commitdiff
Fix http://llvm.org/bugs/show_bug.cgi?id=3907.
authorSteve Naroff <snaroff@apple.com>
Thu, 2 Apr 2009 18:37:59 +0000 (18:37 +0000)
committerSteve Naroff <snaroff@apple.com>
Thu, 2 Apr 2009 18:37:59 +0000 (18:37 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68338 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Parse/ParseExpr.cpp
test/SemaObjC/class-property-access.m [new file with mode: 0644]

index f10cb383dda31c8f5369da9b1a6f76743113d0af..6713ca920eff6ea6e3bc0b5c6c141f9a13f104ce 100644 (file)
@@ -589,7 +589,8 @@ Parser::OwningExprResult Parser::ParseCastExpression(bool isUnaryExpression,
       
       Res = Actions.ActOnClassPropertyRefExpr(ReceiverName, PropertyName,
                                               IdentLoc, PropertyLoc);
-      return move(Res);
+      // These can be followed by postfix-expr pieces.
+      return ParsePostfixExpressionSuffix(move(Res));
     }
     // Consume the identifier so that we can see if it is followed by a '('.
     // Function designators are allowed to be undeclared (C99 6.5.1p2), so we
diff --git a/test/SemaObjC/class-property-access.m b/test/SemaObjC/class-property-access.m
new file mode 100644 (file)
index 0000000..663b87d
--- /dev/null
@@ -0,0 +1,12 @@
+// RUN: clang -fsyntax-only -verify %s
+
+@interface Test {}
++ (Test*)one;
+- (int)two;
+@end
+
+int main ()
+{
+  return Test.one.two;
+}
+