mirror of https://github.com/microsoft/clang.git
[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:
parent
95a3256ad0
commit
3032d1e276
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue