ObjCInterfaceDecl *lookupInheritedClass(const IdentifierInfo *ICName);
// Lookup a method in the classes implementation hierarchy.
- ObjCMethodDecl *lookupPrivateInstanceMethod(const Selector &Sel);
+ ObjCMethodDecl *lookupPrivateMethod(const Selector &Sel, bool Instance=true);
// Location information, modeled after the Stmt API.
SourceLocation getLocStart() const { return getLocation(); } // '@'interface
return NULL;
}
-ObjCMethodDecl *ObjCInterfaceDecl::lookupPrivateInstanceMethod(
- const Selector &Sel) {
+ObjCMethodDecl *ObjCInterfaceDecl::lookupPrivateMethod(
+ const Selector &Sel,
+ bool Instance) {
ObjCMethodDecl *Method = 0;
if (ObjCImplementationDecl *ImpDecl = getImplementation())
- Method = ImpDecl->getInstanceMethod(Sel);
+ Method = Instance ? ImpDecl->getInstanceMethod(Sel)
+ : ImpDecl->getClassMethod(Sel);
if (!Method && getSuperClass())
- return getSuperClass()->lookupPrivateInstanceMethod(Sel);
+ return getSuperClass()->lookupPrivateMethod(Sel, Instance);
return Method;
}
if (ObjCMethodDecl *MD = getCurMethodDecl()) {
ObjCInterfaceDecl *IFace = MD->getClassInterface();
ObjCMethodDecl *Getter;
- // FIXME: need to also look locally in the implementation.
if ((Getter = IFace->lookupClassMethod(Sel))) {
// Check the use of this method.
if (DiagnoseUseOfDecl(Getter, MemberLoc))
return ExprError();
}
+ else
+ Getter = IFace->lookupPrivateMethod(Sel, false);
// If we found a getter then this may be a valid dot-reference, we
// will look for the matching setter, in case it is needed.
Selector SetterSel =
if (!Setter) {
// If this reference is in an @implementation, also check for 'private'
// methods.
- Setter = IFace->lookupPrivateInstanceMethod(SetterSel);
+ Setter = IFace->lookupPrivateMethod(SetterSel, false);
}
// Look through local category implementations associated with the class.
if (!Setter)
// If this reference is in an @implementation, check for 'private' methods.
if (!Getter)
- Getter = IFace->lookupPrivateInstanceMethod(Sel);
+ Getter = IFace->lookupPrivateMethod(Sel);
// Look through local category implementations associated with the class.
if (!Getter)
if (!Setter) {
// If this reference is in an @implementation, also check for 'private'
// methods.
- Setter = IFace->lookupPrivateInstanceMethod(SetterSel);
+ Setter = IFace->lookupPrivateMethod(SetterSel);
}
// Look through local category implementations associated with the class.
if (!Setter)
@synthesize Y; // expected-note {{previous use is here}}
@synthesize Z=Y; // expected-error {{synthesized properties 'Z' and 'Y' both claim ivar 'Y'}}
@end
+
+// rdar://8703553
+@interface IDEPathCell
+{
+@private
+ id _gradientStyle;
+}
+
+@property (readwrite, assign, nonatomic) id gradientStyle;
+@end
+
+@implementation IDEPathCell
+
+@synthesize gradientStyle = _gradientStyle;
+- (void)setGradientStyle:(id)value { }
+
++ (void)_componentCellWithRepresentedObject {
+ self.gradientStyle; // expected-error {{property 'gradientStyle' not found on object of type 'Class'}}
+}
+@end