Douglas Gregor | 2224f84 | 2009-02-25 16:33:18 +0000 | [diff] [blame] | 1 | // RUN: clang -fsyntax-only -verify %s |
| 2 | |
| 3 | // C DR #316, PR 3626. |
| 4 | void f0(a, b, c, d) int a,b,c,d; {} |
| 5 | void t0(void) { f0(1); } |
| 6 | |
| 7 | void f1(a, b) int a, b; {} |
| 8 | void t1(void) { f1(1, 2, 3); } |
| 9 | |
| 10 | void f2(float); // expected-note{{previous declaration is here}} |
Douglas Gregor | c837656 | 2009-03-06 22:43:54 +0000 | [diff] [blame^] | 11 | void 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 Gregor | 2224f84 | 2009-02-25 16:33:18 +0000 | [diff] [blame] | 12 | |
| 13 | typedef void (*f3)(void); |
| 14 | f3 t3(int b) { return b? f0 : f1; } // okay |