knr-def-call.c revision 2224f84658fb9b3725a31f2680edb64ae73bf705
12224f84658fb9b3725a31f2680edb64ae73bf705Douglas Gregor// RUN: clang -fsyntax-only -verify %s 22224f84658fb9b3725a31f2680edb64ae73bf705Douglas Gregor 32224f84658fb9b3725a31f2680edb64ae73bf705Douglas Gregor// C DR #316, PR 3626. 42224f84658fb9b3725a31f2680edb64ae73bf705Douglas Gregorvoid f0(a, b, c, d) int a,b,c,d; {} 52224f84658fb9b3725a31f2680edb64ae73bf705Douglas Gregorvoid t0(void) { f0(1); } 62224f84658fb9b3725a31f2680edb64ae73bf705Douglas Gregor 72224f84658fb9b3725a31f2680edb64ae73bf705Douglas Gregorvoid f1(a, b) int a, b; {} 82224f84658fb9b3725a31f2680edb64ae73bf705Douglas Gregorvoid t1(void) { f1(1, 2, 3); } 92224f84658fb9b3725a31f2680edb64ae73bf705Douglas Gregor 102224f84658fb9b3725a31f2680edb64ae73bf705Douglas Gregorvoid f2(float); // expected-note{{previous declaration is here}} 112224f84658fb9b3725a31f2680edb64ae73bf705Douglas Gregorvoid f2(x) float x; { } // expected-error{{conflicting types for 'f2'}} 122224f84658fb9b3725a31f2680edb64ae73bf705Douglas Gregor 132224f84658fb9b3725a31f2680edb64ae73bf705Douglas Gregortypedef void (*f3)(void); 142224f84658fb9b3725a31f2680edb64ae73bf705Douglas Gregorf3 t3(int b) { return b? f0 : f1; } // okay 15