blob: d43031eee0b56c837b6e8ac847f37947ed679955 [file] [log] [blame]
Fariborz Jahanian08602352012-09-17 19:15:26 +00001// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
Fariborz Jahanian03ebd3b2012-09-17 23:09:59 +00002// RUN: %clang_cc1 -x objective-c++ -fsyntax-only -verify -Wno-objc-root-class -Wmissing-selector-name %s
Fariborz Jahanian08602352012-09-17 19:15:26 +00003// rdar://12263549
4
5@interface Super @end
6@interface INTF : Super
7-(void) Name1:(id)Arg1 Name2:(id)Arg2; // Name1:Name2:
Fariborz Jahanian03ebd3b2012-09-17 23:09:59 +00008-(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 // expected-note {{introduce a parameter name to make 'Name2' part of the selector}} \
10 // expected-note {{or insert whitespace before ':' to use 'Name2' as parameter name and have an empty entry in the selector}}
Fariborz Jahanian08602352012-09-17 19:15:26 +000011-(void) Name1:(id)Arg1 Name2:(id)Arg2 Name3:(id)Arg3; // Name1:Name2:Name3:
Fariborz Jahanian03ebd3b2012-09-17 23:09:59 +000012-(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 // expected-note {{introduce a parameter name to make 'Name3' part of the selector}} \
14 // expected-note {{or insert whitespace before ':' to use 'Name3' as parameter name and have an empty entry in the selector}}
Fariborz Jahanianfa1ed8e2012-09-17 23:24:36 +000015- method:(id) second:(id)second; // expected-warning {{'second' used as the name of the previous parameter rather than as part of the selector}} \
16 // expected-note {{introduce a parameter name to make 'second' part of the selector}} \
17 // expected-note {{or insert whitespace before ':' to use 'second' as parameter name and have an empty entry in the selector}} \
18 // expected-note {{method definition for 'method::' not found}}
19
Fariborz Jahanian08602352012-09-17 19:15:26 +000020@end
21
Fariborz Jahanianfa1ed8e2012-09-17 23:24:36 +000022@implementation INTF // expected-warning {{incomplete implementation}}
Fariborz Jahanian08602352012-09-17 19:15:26 +000023-(void) Name1:(id)Arg1 Name2:(id)Arg2{}
Fariborz Jahanian03ebd3b2012-09-17 23:09:59 +000024-(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 // expected-note {{introduce a parameter name to make 'Name2' part of the selector}} \
26 // expected-note {{or insert whitespace before ':' to use 'Name2' as parameter name and have an empty entry in the selector}}
Fariborz Jahanian08602352012-09-17 19:15:26 +000027-(void) Name1:(id)Arg1 Name2:(id)Arg2 Name3:(id)Arg3 {}
Fariborz Jahanian03ebd3b2012-09-17 23:09:59 +000028-(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 // expected-note {{introduce a parameter name to make 'Name3' part of the selector}} \
30 // expected-note {{or insert whitespace before ':' to use 'Name3' as parameter name and have an empty entry in the selector}}
Fariborz Jahanianfa1ed8e2012-09-17 23:24:36 +000031- method:(id)first second:(id)second {return 0; }
Fariborz Jahanian08602352012-09-17 19:15:26 +000032@end