1 // RUN: clang-cc -fsyntax-only -verify %s
5 void g0(); // expected-note{{previous declaration is here}}
8 g0(1, 2, 3); // expected-error{{too many arguments to function call}}
11 void g0(int); // expected-error{{conflicting types for 'g0'}}
24 int g2(int, int); // expected-note{{previous declaration is here}}
26 INT g2(x) // expected-error{{conflicting types for 'g2'}}
37 void f1(double); // expected-note{{previous declaration is here}}
39 int f1(int); // expected-error{{conflicting types for 'f1'}}
45 extern void g3(int); // expected-note{{previous declaration is here}}
46 static void g3(int x) { } // expected-error{{static declaration of 'g3' follows non-static declaration}}
49 extern int f2; // expected-note 2 {{previous definition is here}}
51 void f2(int); // expected-error{{redefinition of 'f2' as different kind of symbol}}
57 void f2(int); // expected-error{{redefinition of 'f2' as different kind of symbol}}
62 // <rdar://problem/6127293>
63 int outer1(int); // expected-note{{previous declaration is here}}
66 int outer5; // expected-note{{previous definition is here}}
70 int outer1(float); // expected-error{{conflicting types for 'outer1'}}
71 int outer2(int); // expected-note{{previous declaration is here}}
72 int outer3(int); // expected-note{{previous declaration is here}}
73 int outer4(int); // expected-note{{previous declaration is here}}
74 int outer5(int); // expected-error{{redefinition of 'outer5' as different kind of symbol}}
75 int* outer6(int); // expected-note{{previous declaration is here}}
82 int outer2(float); // expected-error{{conflicting types for 'outer2'}}
83 int outer3(float); // expected-error{{conflicting types for 'outer3'}}
84 int outer4(float); // expected-error{{conflicting types for 'outer4'}}
86 void outer_test2(int x) {
87 int* ip = outer6(x); // expected-warning{{use of out-of-scope declaration of 'outer6'}}
92 int *(*fp)(int) = outer8; // expected-error{{use of undeclared identifier 'outer8'}}
95 static float outer8(float); // okay
99 // GNU extension: prototypes and K&R function definitions
100 int isroot(short x, // expected-note{{previous declaration is here}}
104 short x; // expected-warning{{promoted type 'int' of K&R function parameter is not compatible with the parameter type 'short' declared in a previous prototype}}
111 void *h0(unsigned a0, ...);
112 extern __typeof (h0) h1 __attribute__((__sentinel__));
113 extern __typeof (h1) h1 __attribute__((__sentinel__));
116 void i0 (unsigned short a0);
117 extern __typeof (i0) i1;
118 extern __typeof (i1) i1;
121 typedef int a2(int*);
126 x2(5); // expected-warning{{incompatible integer to pointer conversion passing 'int', expected 'int *'}}