1 // RUN: %clang_cc1 -Wstrict-selector-match -fsyntax-only -verify %s
4 -(int) method; // expected-note {{using}}
8 -(float) method; // expected-note {{also found}}
11 int main(void) { [(id)0 method]; } // expected-warning {{multiple methods named 'method' found}}
13 @interface Object @end
16 - (void)setWindow:(Object *)wdw; // expected-note 2 {{using}}
20 - (void)setWindow:(Class1 *)window; // expected-note 2 {{also found}}
26 [obj setWindow:0]; // expected-warning {{Object' may not respond to 'setWindow:'}} \
27 // expected-warning {{multiple methods named 'setWindow:' found}}
28 [obj2 setWindow:0]; // expected-warning {{multiple methods named 'setWindow:' found}}
33 - (id)initWithData:(Object *)data; // expected-note {{also found}}
37 - (id)initWithData:(int)data; // expected-note {{also found}}
41 - (id)initWithData:(id<MyObject, MyCoding>)data; // expected-note {{using}}
44 @interface NTGridDataObject: Object <MyCoding>
46 Object<MyCoding> *_data;
48 + (NTGridDataObject*)dataObject:(id<MyObject, MyCoding>)data;
51 @implementation NTGridDataObject
52 - (id)initWithData:(id<MyObject, MyCoding>)data { // expected-note {{also found}}
55 + (NTGridDataObject*)dataObject:(id<MyObject, MyCoding>)data
57 NTGridDataObject *result = [(id)0 initWithData:data]; // expected-warning {{multiple methods named 'initWithData:' found}}
66 @interface Derived: Base
72 [(Class)0 port]; // OK - gcc issues warning but there is only one Class method so no ambiguity to warn
83 @interface A : NSObject
84 - (instancetype)initWithType:(NSString *)whatever; // expected-note {{also found}}
87 @interface Test : NSObject
93 return [[[self class] alloc] initWithType:3]; // expected-warning {{multiple methods named 'initWithType:'}}
96 - (instancetype)initWithType:(unsigned int)whatever // expected-note {{using}}