-Wselector detects an unimplemented method used
in an @selector expression. // rdar://
15781538
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@199255
91177308-0d34-0410-b5e6-
96231b3b80d8
"property is assumed atomic when auto-synthesizing the property">,
InGroup<ImplicitAtomic>, DefaultIgnore;
def warn_unimplemented_selector: Warning<
- "creating selector for nonexistent method %0">, InGroup<Selector>, DefaultIgnore;
+ "using @selector on method %0 with no implementation in translation unit">,
+ InGroup<Selector>, DefaultIgnore;
def warn_unimplemented_protocol_method : Warning<
"method %0 in protocol %1 not implemented">, InGroup<Protocol>;
// FIXME: Can't verify notes in headers
//[a f2];
- (void)@selector(x); // expected-warning {{creating selector for nonexistent method 'x'}}
- (void)@selector(y); // expected-warning {{creating selector for nonexistent method 'y'}}
- (void)@selector(e); // expected-warning {{creating selector for nonexistent method 'e'}}
+ (void)@selector(x); // expected-warning {{using @selector on method 'x' with no implementation in translation unit}}
+ (void)@selector(y); // expected-warning {{using @selector on method 'y' with no implementation in translation unit}}
+ (void)@selector(e); // expected-warning {{using @selector on method 'e' with no implementation in translation unit}}
}
@implementation X (Blah)
- (void) foo
{
SEL a,b,c;
- a = @selector(b1ar); // expected-warning {{creating selector for nonexistent method 'b1ar'}}
+ a = @selector(b1ar); // expected-warning {{using @selector on method 'b1ar' with no implementation in translation unit}}
b = @selector(bar);
}
@end
SEL func()
{
- return @selector(length); // expected-warning {{creating selector for nonexistent method 'length'}}
+ return @selector(length); // expected-warning {{using @selector on method 'length' with no implementation in translation unit}}
}
// rdar://9545564
@implementation INTF
- (void) Meth {
- if( [cnx respondsToSelector:MySelector(@selector( _setQueue: ))] ) // expected-warning {{creating selector for nonexistent method '_setQueue:'}}
+ if( [cnx respondsToSelector:MySelector(@selector( _setQueue: ))] ) // expected-warning {{using @selector on method '_setQueue:' with no implementation in translation unit}}
{
}