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 'f0'" } */
26 x
.f0(a
); /* { dg-error "too many arguments to function 'x.f0'" } */
27 f0(a
, a
); /* { dg-error "too many arguments to function 'f0'" } */
28 x
.f0(a
, a
); /* { dg-error "too many arguments to function 'x.f0'" } */
29 f1(); /* { dg-error "too few arguments to function 'f1'" } */
30 x
.f1(); /* { dg-error "too few arguments to function 'x.f1'" } */
33 f1(a
, a
); /* { dg-error "too many arguments to function 'f1'" } */
34 x
.f1(a
, a
); /* { dg-error "too many arguments to function 'x.f1'" } */
35 f1v(); /* { dg-error "too few arguments to function 'f1v'" } */
36 x
.f1v(); /* { dg-error "too few arguments to function 'x.f1v'" } */
41 f2(a
); /* { dg-error "too few arguments to function 'f2'" } */
42 x
.f2(a
); /* { dg-error "too few arguments to function 'x.f2'" } */
45 f2(a
, a
, a
); /* { dg-error "too many arguments to function 'f2'" } */
46 x
.f2(a
, a
, a
); /* { dg-error "too many arguments to function 'x.f2'" } */
47 f2v(a
); /* { dg-error "too few arguments to function 'f2v'" } */
48 x
.f2v(a
); /* { dg-error "too few arguments to function 'x.f2v'" } */