1 // RUN: %clang_cc1 -Wselector-type-mismatch -verify %s 2 3 @interface I 4 - (id) compare: (char) arg1; // expected-note {{method 'compare:' declared here}} 5 - length; 6 @end 7 8 @interface J 9 - (id) compare: (id) arg1; // expected-note {{method 'compare:' declared here}} 10 @end 11 12 SEL func() 13 { 14 return @selector(compare:); // expected-warning {{several methods with selector 'compare:' of mismatched types are found for the @selector expression}} 15 } 16 17 // rdar://16458579 18 void Test16458579() { 19 SEL s = @selector((retain)); 20 SEL s1 = @selector((meth1:)); 21 SEL s2 = @selector((retainArgument::)); 22 SEL s3 = @selector((retainArgument:::::)); 23 SEL s4 = @selector((retainArgument:with:)); 24 SEL s5 = @selector((meth1:with:with:)); 25 SEL s6 = @selector((getEnum:enum:bool:)); 26 SEL s7 = @selector((char:float:double:unsigned:short:long:)); 27 SEL s9 = @selector((:enum:bool:)); 28 } 29 int main() { 30 SEL s = @selector(retain); 31 SEL s1 = @selector(meth1:); 32 SEL s2 = @selector(retainArgument::); 33 SEL s3 = @selector(retainArgument:::::); 34 SEL s4 = @selector(retainArgument:with:); 35 SEL s5 = @selector(meth1:with:with:); 36 SEL s6 = @selector(getEnum:enum:bool:); 37 SEL s7 = @selector(char:float:double:unsigned:short:long:); 38 39 SEL s9 = @selector(:enum:bool:); 40 } 41 42 // rdar://15794055 43 @interface NSObject @end 44 45 @class NSNumber; 46 47 @interface XBRecipe : NSObject 48 @property (nonatomic, assign) float finalVolume; // expected-note {{method 'setFinalVolume:' declared here}} 49 @end 50 51 @interface XBDocument : NSObject 52 @end 53 54 @interface XBDocument () 55 - (void)setFinalVolume:(NSNumber *)finalVolumeNumber; // expected-note {{method 'setFinalVolume:' declared here}} 56 @end 57 58 @implementation XBDocument 59 - (void)setFinalVolume:(NSNumber *)finalVolumeNumber 60 { 61 (void)@selector(setFinalVolume:); // expected-warning {{several methods with selector 'setFinalVolume:' of mismatched types are found for the @selector expression}} 62 } 63 @end 64