1 /* Test messages for wrong number of arguments to function. */
2 /* Origin: Joseph Myers <jsm@polyomino.org.uk> */
3 /* { dg-do compile } */
4 /* { dg-options "" } */
6 void f0(void); /* { dg-message "note: declared here" } */
7 void f1(int); /* { dg-message "note: declared here" } */
8 void f1v(int, ...); /* { dg-message "note: declared here" } */
9 void f2(int, int); /* { dg-message "note: declared here" } */
10 void f2v(int, int, ...); /* { dg-message "note: declared here" } */
15 void (*f1v)(int, ...);
17 void (*f2v)(int, int, ...);
25 f0(a); /* { dg-error "too many arguments to function" } */
26 x.f0(a); /* { dg-error "too many arguments to function" } */
27 f0(a, a); /* { dg-error "too many arguments to function" } */
28 x.f0(a, a); /* { dg-error "too many arguments to function" } */
29 f1(); /* { dg-error "too few arguments to function" } */
30 x.f1(); /* { dg-error "too few arguments to function" } */
33 f1(a, a); /* { dg-error "too many arguments to function" } */
34 x.f1(a, a); /* { dg-error "too many arguments to function" } */
35 f1v(); /* { dg-error "too few arguments to function" } */
36 x.f1v(); /* { dg-error "too few arguments to function" } */
41 f2(a); /* { dg-error "too few arguments to function" } */
42 x.f2(a); /* { dg-error "too few arguments to function" } */
45 f2(a, a, a); /* { dg-error "too many arguments to function" } */
46 x.f2(a, a, a); /* { dg-error "too many arguments to function" } */
47 f2v(a); /* { dg-error "too few arguments to function" } */
48 x.f2v(a); /* { dg-error "too few arguments to function" } */