function.c revision 777f07b6cd595bb0922e05768e5703fbc92b5695
1// RUN: clang %s -fsyntax-only -verify -pedantic
2// PR1892
3void f(double a[restrict][5]);  // should promote to restrict ptr.
4void f(double (* restrict a)[5]);
5
6int foo (__const char *__path);
7int foo(__const char *__restrict __file);
8
9void func(const char*); // expected-note {{previous declaration is here}}
10void func(char*); // expected-error{{conflicting types for 'func'}}
11
12void g(int (*)(const void **, const void **));
13void g(int (*compar)()) {
14}
15
16void h();  // expected-note {{previous declaration is here}}
17void h (const char *fmt, ...) {} // expected-error{{conflicting types for 'h'}}
18
19// PR1965
20int t5(b);          // expected-error {{parameter list without types}}
21int t6(int x, g);   // expected-warning {{type specifier missing, defaults to 'int'}}
22
23int t7(, );       // expected-error {{expected parameter declarator}} expected-error {{expected parameter declarator}}
24int t8(, int a);  // expected-error {{expected parameter declarator}}
25int t9(int a, );  // expected-error {{expected parameter declarator}}
26
27
28// PR2042
29void t10(){}
30void t11(){t10(1);}
31
32// PR3208
33void t12(int) {}  // expected-error{{parameter name omitted}}
34
35