xref: /aosp_15_r20/external/clang/test/SemaObjC/objc-cstyle-args-in-methods.m (revision 67e74705e28f6214e480b399dd47ea732279e315)
1*67e74705SXin Li// RUN: %clang_cc1  -fsyntax-only -Wno-deprecated-declarations -verify -Wno-objc-root-class %s
2*67e74705SXin Li
3*67e74705SXin Li@interface Foo
4*67e74705SXin Li- (id)test:(id)one, id two;
5*67e74705SXin Li- (id)bad:(id)one, id two, double three;
6*67e74705SXin Li@end
7*67e74705SXin Li
8*67e74705SXin Li@implementation Foo
9*67e74705SXin Li- (id)test:(id )one, id two {return two; }
10*67e74705SXin Li- (id)bad:(id)one, id two, double three { return two; }
11*67e74705SXin Li@end
12*67e74705SXin Li
13*67e74705SXin Li
14*67e74705SXin Liint main() {
15*67e74705SXin Li	Foo *foo;
16*67e74705SXin Li	[foo test:@"One", @"Two"];
17*67e74705SXin Li	[foo bad:@"One", @"Two"]; // expected-error {{too few arguments to method call}}
18*67e74705SXin Li	[foo bad:@"One", @"Two", 3.14];
19*67e74705SXin Li	[foo bad:@"One", @"Two", 3.14, @"Two"]; // expected-error {{too many arguments to method call}}
20*67e74705SXin Li}
21