[Objective-C Sema]. Don't warn about use of

property accessors in @selector not implemented 
because they will be auto-synthesized. rdar://16607480


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@229919 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Fariborz Jahanian 2015-02-19 21:52:41 +00:00
parent 95a3256ad0
commit 3032d1e276
2 changed files with 27 additions and 2 deletions

View File

@ -2441,12 +2441,16 @@ ObjCMethodDecl *Sema::LookupImplementedMethodInGlobalPool(Selector Sel) {
GlobalMethods &Methods = Pos->second;
for (const ObjCMethodList *Method = &Methods.first; Method;
Method = Method->getNext())
if (Method->getMethod() && Method->getMethod()->isDefined())
if (Method->getMethod() &&
(Method->getMethod()->isDefined() ||
Method->getMethod()->isPropertyAccessor()))
return Method->getMethod();
for (const ObjCMethodList *Method = &Methods.second; Method;
Method = Method->getNext())
if (Method->getMethod() && Method->getMethod()->isDefined())
if (Method->getMethod() &&
(Method->getMethod()->isDefined() ||
Method->getMethod()->isPropertyAccessor()))
return Method->getMethod();
return nullptr;
}

View File

@ -134,3 +134,24 @@ void test16428638() {
SEL s = @selector(compare:);
(void)s;
}
// rdar://16607480
@class NSString;
@interface SELCanary : NSObject
@property (readonly, nonatomic) NSString *name;
@property (nonatomic, getter = isHidden) char hidden;
@property (nonatomic, copy, getter = hasFish, setter = setFish:) NSString *ridiculousFish;
@end
@implementation SELCanary
- (void) Meth {
SEL properties[] = {
@selector(name),
@selector(isHidden),
@selector(setHidden:),
@selector(hasFish),
@selector(setFish:)
};
}
@end