knr-def-call.c revision c837656ca6d2a5b434923d7e2fd11d3a3c3bfa74
1// RUN: clang -fsyntax-only -verify %s
2
3// C DR #316, PR 3626.
4void f0(a, b, c, d) int a,b,c,d; {}
5void t0(void) { f0(1); }
6
7void f1(a, b) int a, b; {}
8void t1(void) { f1(1, 2, 3); }
9
10void f2(float); // expected-note{{previous declaration is here}}
11void f2(x) float x; { } // expected-warning{{promoted type 'double' of K&R function parameter is not compatible with the parameter type 'float' declared in a previous prototype}}
12
13typedef void (*f3)(void);
14f3 t3(int b) { return b? f0 : f1; } // okay
15