forked from OSchip/llvm-project
Fix <rdar://problem/6268365> Parser rejects property (dot notation) access on id<protocol>.
llvm-svn: 57850
This commit is contained in:
parent
7e721ecd21
commit
bca9fd755d
|
@ -999,7 +999,15 @@ ActOnMemberReferenceExpr(ExprTy *Base, SourceLocation OpLoc,
|
|||
MemberLoc, BaseExpr);
|
||||
}
|
||||
}
|
||||
|
||||
// Handle properties on qualified "id" protocols.
|
||||
const ObjCQualifiedIdType *QIdTy;
|
||||
if (OpKind == tok::period && (QIdTy = BaseType->getAsObjCQualifiedIdType())) {
|
||||
// Check protocols on qualified interfaces.
|
||||
for (ObjCQualifiedIdType::qual_iterator I = QIdTy->qual_begin(),
|
||||
E = QIdTy->qual_end(); I != E; ++I)
|
||||
if (ObjCPropertyDecl *PD = (*I)->FindPropertyDeclaration(&Member))
|
||||
return new ObjCPropertyRefExpr(PD, PD->getType(), MemberLoc, BaseExpr);
|
||||
}
|
||||
// Handle 'field access' to vectors, such as 'V.xx'.
|
||||
if (BaseType->isExtVectorType() && OpKind == tok::period) {
|
||||
// Component access limited to variables (reject vec4.rg.g).
|
||||
|
|
|
@ -62,3 +62,23 @@ typedef signed char BOOL;
|
|||
|
||||
@end
|
||||
|
||||
@protocol PVImageViewProtocol
|
||||
@property int inEyeDropperMode;
|
||||
@end
|
||||
|
||||
@interface Cls
|
||||
@property int inEyeDropperMode;
|
||||
@end
|
||||
|
||||
@interface PVAdjustColor @end
|
||||
|
||||
@implementation PVAdjustColor
|
||||
|
||||
- xx {
|
||||
id <PVImageViewProtocol> view;
|
||||
Cls *c;
|
||||
|
||||
c.inEyeDropperMode = 1;
|
||||
view.inEyeDropperMode = 1;
|
||||
}
|
||||
@end
|
||||
|
|
Loading…
Reference in New Issue