mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-17 01:36:38 +00:00

A significant number of our tests in C accidentally use functions without prototypes. This patch converts the function signatures to have a prototype for the situations where the test is not specific to K&R C declarations. e.g., void func(); becomes void func(void); This is the fourth batch of tests being updated (there are a significant number of other tests left to be updated).
21 lines
584 B
Objective-C
21 lines
584 B
Objective-C
// RUN: %clang_cc1 -fsyntax-only -Wno-deprecated-declarations -verify -Wno-objc-root-class %s
|
|
|
|
@interface Foo
|
|
- (id)test:(id)one, id two;
|
|
- (id)bad:(id)one, id two, double three;
|
|
@end
|
|
|
|
@implementation Foo
|
|
- (id)test:(id )one, id two {return two; }
|
|
- (id)bad:(id)one, id two, double three { return two; }
|
|
@end
|
|
|
|
|
|
int main(void) {
|
|
Foo *foo;
|
|
[foo test:@"One", @"Two"];
|
|
[foo bad:@"One", @"Two"]; // expected-error {{too few arguments to method call}}
|
|
[foo bad:@"One", @"Two", 3.14];
|
|
[foo bad:@"One", @"Two", 3.14, @"Two"]; // expected-error {{too many arguments to method call}}
|
|
}
|