From fc58ca4af60d8a6209fa7df029e59a34cafe01b3 Mon Sep 17 00:00:00 2001 From: Fariborz Jahanian Date: Wed, 8 Apr 2009 19:50:10 +0000 Subject: [PATCH] Fixed a problem using property syntax on a 'super' used as receiver. llvm-svn: 68631 --- clang/lib/Parse/ParseObjc.cpp | 8 ++++--- .../SemaObjC/super-property-message-expr.m | 21 +++++++++++++++++++ 2 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 clang/test/SemaObjC/super-property-message-expr.m diff --git a/clang/lib/Parse/ParseObjc.cpp b/clang/lib/Parse/ParseObjc.cpp index 8a942c77027a..bac3f91d0af7 100644 --- a/clang/lib/Parse/ParseObjc.cpp +++ b/clang/lib/Parse/ParseObjc.cpp @@ -1449,9 +1449,11 @@ Parser::OwningExprResult Parser::ParseObjCMessageExpression() { // Parse receiver if (isTokObjCMessageIdentifierReceiver()) { IdentifierInfo *ReceiverName = Tok.getIdentifierInfo(); - SourceLocation NameLoc = ConsumeToken(); - return ParseObjCMessageExpressionBody(LBracLoc, NameLoc, ReceiverName, - ExprArg(Actions)); + if (ReceiverName != Ident_super || GetLookAheadToken(1).isNot(tok::period)) { + SourceLocation NameLoc = ConsumeToken(); + return ParseObjCMessageExpressionBody(LBracLoc, NameLoc, ReceiverName, + ExprArg(Actions)); + } } OwningExprResult Res(ParseExpression()); diff --git a/clang/test/SemaObjC/super-property-message-expr.m b/clang/test/SemaObjC/super-property-message-expr.m new file mode 100644 index 000000000000..082d8bd5b48a --- /dev/null +++ b/clang/test/SemaObjC/super-property-message-expr.m @@ -0,0 +1,21 @@ +// RUN: clang-cc -fsyntax-only -verify %s + +@interface SStoreNodeInfo + +@property(nonatomic,readonly,retain) id descriptionShort; + +- (id)stringByAppendingFormat:(int)format, ... ; + +@end + +@interface SStoreNodeInfo_iDisk : SStoreNodeInfo +{ +@private + id _etag; +} +@end + +@implementation SStoreNodeInfo_iDisk +- (id) X { return [super.descriptionShort stringByAppendingFormat:1, _etag]; } + +@end