blob: 83a0c5e24cbc80ebfa68bd8e4fc6fdaae545528f [file] [log] [blame]
Douglas Gregor2224f842009-02-25 16:33:18 +00001// 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}}
Douglas Gregorc8376562009-03-06 22:43:54 +000011void 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}}
Douglas Gregor2224f842009-02-25 16:33:18 +000012
13typedef void (*f3)(void);
14f3 t3(int b) { return b? f0 : f1; } // okay