| 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(void) |
| 13 |
{ |
| 14 |
return @selector(compare:); // expected-warning {{several methods with selector 'compare:' of mismatched types are found for the @selector expression}} |
| 15 |
} |
| 16 |
|
| 17 |
void Test16458579(void) { |
| 18 |
SEL s = @selector((retain)); |
| 19 |
SEL s1 = @selector((meth1:)); |
| 20 |
SEL s2 = @selector((retainArgument::)); |
| 21 |
SEL s3 = @selector((retainArgument:::::)); |
| 22 |
SEL s4 = @selector((retainArgument:with:)); |
| 23 |
SEL s5 = @selector((meth1:with:with:)); |
| 24 |
SEL s6 = @selector((getEnum:enum:bool:)); |
| 25 |
SEL s7 = @selector((char:float:double:unsigned:short:long:)); |
| 26 |
SEL s9 = @selector((:enum:bool:)); |
| 27 |
} |
| 28 |
int main(void) { |
| 29 |
SEL s = @selector(retain); |
| 30 |
SEL s1 = @selector(meth1:); |
| 31 |
SEL s2 = @selector(retainArgument::); |
| 32 |
SEL s3 = @selector(retainArgument:::::); |
| 33 |
SEL s4 = @selector(retainArgument:with:); |
| 34 |
SEL s5 = @selector(meth1:with:with:); |
| 35 |
SEL s6 = @selector(getEnum:enum:bool:); |
| 36 |
SEL s7 = @selector(char:float:double:unsigned:short:long:); |
| 37 |
|
| 38 |
SEL s9 = @selector(:enum:bool:); |
| 39 |
} |
| 40 |
|
| 41 |
@interface NSObject @end |
| 42 |
|
| 43 |
@class NSNumber; |
| 44 |
|
| 45 |
@interface XBRecipe : NSObject |
| 46 |
@property (nonatomic, assign) float finalVolume; // expected-note {{method 'setFinalVolume:' declared here}} |
| 47 |
@end |
| 48 |
|
| 49 |
@interface XBDocument : NSObject |
| 50 |
@end |
| 51 |
|
| 52 |
@interface XBDocument () |
| 53 |
- (void)setFinalVolume:(NSNumber *)finalVolumeNumber; // expected-note {{method 'setFinalVolume:' declared here}} |
| 54 |
@end |
| 55 |
|
| 56 |
@implementation XBDocument |
| 57 |
- (void)setFinalVolume:(NSNumber *)finalVolumeNumber |
| 58 |
{ |
| 59 |
(void)@selector(setFinalVolume:); // expected-warning {{several methods with selector 'setFinalVolume:' of mismatched types are found for the @selector expression}} |
| 60 |
} |
| 61 |
@end |