2012-09-18 03:15:26 +08:00
|
|
|
// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
|
2012-09-18 07:09:59 +08:00
|
|
|
// RUN: %clang_cc1 -x objective-c++ -fsyntax-only -verify -Wno-objc-root-class -Wmissing-selector-name %s
|
2012-09-18 03:15:26 +08:00
|
|
|
// rdar://12263549
|
|
|
|
|
|
|
|
@interface Super @end
|
|
|
|
@interface INTF : Super
|
|
|
|
-(void) Name1:(id)Arg1 Name2:(id)Arg2; // Name1:Name2:
|
2012-09-18 07:09:59 +08:00
|
|
|
-(void) Name1:(id) Name2:(id)Arg2; // expected-warning {{'Name2' used as the name of the previous parameter rather than as part of the selector}} \
|
|
|
|
// expected-note {{introduce a parameter name to make 'Name2' part of the selector}} \
|
|
|
|
// expected-note {{or insert whitespace before ':' to use 'Name2' as parameter name and have an empty entry in the selector}}
|
2012-09-18 03:15:26 +08:00
|
|
|
-(void) Name1:(id)Arg1 Name2:(id)Arg2 Name3:(id)Arg3; // Name1:Name2:Name3:
|
2012-09-18 07:09:59 +08:00
|
|
|
-(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}} \
|
|
|
|
// expected-note {{introduce a parameter name to make 'Name3' part of the selector}} \
|
|
|
|
// expected-note {{or insert whitespace before ':' to use 'Name3' as parameter name and have an empty entry in the selector}}
|
2012-09-18 07:24:36 +08:00
|
|
|
- method:(id) second:(id)second; // expected-warning {{'second' used as the name of the previous parameter rather than as part of the selector}} \
|
|
|
|
// expected-note {{introduce a parameter name to make 'second' part of the selector}} \
|
|
|
|
// expected-note {{or insert whitespace before ':' to use 'second' as parameter name and have an empty entry in the selector}} \
|
2013-03-27 08:02:21 +08:00
|
|
|
// expected-note {{method 'method::' declared here}}
|
2012-09-18 07:24:36 +08:00
|
|
|
|
2012-09-18 03:15:26 +08:00
|
|
|
@end
|
|
|
|
|
2013-03-27 08:02:21 +08:00
|
|
|
@implementation INTF // expected-warning {{method definition for 'method::' not found}}
|
2012-09-18 03:15:26 +08:00
|
|
|
-(void) Name1:(id)Arg1 Name2:(id)Arg2{}
|
2012-09-18 07:09:59 +08:00
|
|
|
-(void) Name1:(id) Name2:(id)Arg2 {} // expected-warning {{'Name2' used as the name of the previous parameter rather than as part of the selector}} \
|
|
|
|
// expected-note {{introduce a parameter name to make 'Name2' part of the selector}} \
|
|
|
|
// expected-note {{or insert whitespace before ':' to use 'Name2' as parameter name and have an empty entry in the selector}}
|
2012-09-18 03:15:26 +08:00
|
|
|
-(void) Name1:(id)Arg1 Name2:(id)Arg2 Name3:(id)Arg3 {}
|
2012-09-18 07:09:59 +08:00
|
|
|
-(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}} \
|
|
|
|
// expected-note {{introduce a parameter name to make 'Name3' part of the selector}} \
|
|
|
|
// expected-note {{or insert whitespace before ':' to use 'Name3' as parameter name and have an empty entry in the selector}}
|
2012-09-18 07:24:36 +08:00
|
|
|
- method:(id)first second:(id)second {return 0; }
|
2012-09-18 03:15:26 +08:00
|
|
|
@end
|