diff --git a/clang/lib/Parse/ParseExpr.cpp b/clang/lib/Parse/ParseExpr.cpp index f10cb383dda3..6713ca920eff 100644 --- a/clang/lib/Parse/ParseExpr.cpp +++ b/clang/lib/Parse/ParseExpr.cpp @@ -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/clang/test/SemaObjC/class-property-access.m b/clang/test/SemaObjC/class-property-access.m new file mode 100644 index 000000000000..663b87d2ff18 --- /dev/null +++ b/clang/test/SemaObjC/class-property-access.m @@ -0,0 +1,12 @@ +// RUN: clang -fsyntax-only -verify %s + +@interface Test {} ++ (Test*)one; +- (int)two; +@end + +int main () +{ + return Test.one.two; +} +