xref: /minix3/external/bsd/llvm/dist/clang/test/SemaObjC/warning-missing-selector-name.m (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc// RUN: %clang_cc1  -fsyntax-only -verify -Wno-objc-root-class %s
2*f4a2713aSLionel Sambuc// RUN: %clang_cc1 -x objective-c++ -fsyntax-only -verify -Wno-objc-root-class -Wmissing-selector-name %s
3*f4a2713aSLionel Sambuc// rdar://12263549
4*f4a2713aSLionel Sambuc
5*f4a2713aSLionel Sambuc@interface Super @end
6*f4a2713aSLionel Sambuc@interface INTF : Super
7*f4a2713aSLionel Sambuc-(void) Name1:(id)Arg1 Name2:(id)Arg2; // Name1:Name2:
8*f4a2713aSLionel Sambuc-(void) Name1:(id) Name2:(id)Arg2; // expected-warning {{'Name2' used as the name of the previous parameter rather than as part of the selector}} \
9*f4a2713aSLionel Sambuc				   // expected-note {{introduce a parameter name to make 'Name2' part of the selector}} \
10*f4a2713aSLionel Sambuc				   // expected-note {{or insert whitespace before ':' to use 'Name2' as parameter name and have an empty entry in the selector}}
11*f4a2713aSLionel Sambuc-(void) Name1:(id)Arg1 Name2:(id)Arg2 Name3:(id)Arg3; // Name1:Name2:Name3:
12*f4a2713aSLionel Sambuc-(void) Name1:(id)Arg1 Name2:(id) Name3:(id)Arg3; // expected-warning {{'Name3' used as the name of the previous parameter rather than as part of the selector}} \
13*f4a2713aSLionel Sambuc				   // expected-note {{introduce a parameter name to make 'Name3' part of the selector}} \
14*f4a2713aSLionel Sambuc				   // expected-note {{or insert whitespace before ':' to use 'Name3' as parameter name and have an empty entry in the selector}}
15*f4a2713aSLionel Sambuc- method:(id) second:(id)second; // expected-warning {{'second' used as the name of the previous parameter rather than as part of the selector}} \
16*f4a2713aSLionel Sambuc				   // expected-note {{introduce a parameter name to make 'second' part of the selector}} \
17*f4a2713aSLionel Sambuc				   // expected-note {{or insert whitespace before ':' to use 'second' as parameter name and have an empty entry in the selector}} \
18*f4a2713aSLionel Sambuc				   // expected-note {{method 'method::' declared here}}
19*f4a2713aSLionel Sambuc
20*f4a2713aSLionel Sambuc@end
21*f4a2713aSLionel Sambuc
22*f4a2713aSLionel Sambuc@implementation INTF // expected-warning {{method definition for 'method::' not found}}
23*f4a2713aSLionel Sambuc-(void) Name1:(id)Arg1 Name2:(id)Arg2{}
24*f4a2713aSLionel Sambuc-(void) Name1:(id) Name2:(id)Arg2 {} // expected-warning {{'Name2' used as the name of the previous parameter rather than as part of the selector}} \
25*f4a2713aSLionel Sambuc					// expected-note {{introduce a parameter name to make 'Name2' part of the selector}} \
26*f4a2713aSLionel Sambuc 					// expected-note {{or insert whitespace before ':' to use 'Name2' as parameter name and have an empty entry in the selector}}
27*f4a2713aSLionel Sambuc-(void) Name1:(id)Arg1 Name2:(id)Arg2 Name3:(id)Arg3 {}
28*f4a2713aSLionel Sambuc-(void) Name1:(id)Arg1 Name2:(id) Name3:(id)Arg3 {} // expected-warning {{'Name3' used as the name of the previous parameter rather than as part of the selector}} \
29*f4a2713aSLionel Sambuc					// expected-note {{introduce a parameter name to make 'Name3' part of the selector}} \
30*f4a2713aSLionel Sambuc 					// expected-note {{or insert whitespace before ':' to use 'Name3' as parameter name and have an empty entry in the selector}}
31*f4a2713aSLionel Sambuc- method:(id)first second:(id)second {return 0; }
32*f4a2713aSLionel Sambuc@end
33