PR middle-end/77357 - strlen of constant strings not folded
[official-gcc.git] / gcc / testsuite / gcc.dg / call-diag-2.c
blobf7e66ebb36d246c3f95da75460f7cdedcc7514b9
1 /* Test diagnostics for calling function returning qualified void or
2 other incomplete type other than void. PR 35210. */
3 /* { dg-do compile } */
4 /* { dg-options "-std=gnu99 -pedantic-errors" } */
6 const void f_cv (void);
7 struct s f_s (void);
8 void f_v (void);
10 void g1 (void) { f_cv (); } /* { dg-error "qualified void" } */
11 void g2 (void) { f_s (); } /* { dg-error "invalid use of undefined type" } */
12 void g3 (void) { ((const void (*) (void)) f_v) (); } /* { dg-error "qualified void" } */
13 /* { dg-warning "function called through a non-compatible type" "cast" { target *-*-* } .-1 } */
14 void g4 (void) { ((struct s (*) (void)) f_v) (), (void) 0; } /* { dg-error "invalid use of undefined type" } */
15 /* { dg-warning "function called through a non-compatible type" "cast" { target *-*-* } .-1 } */