OSDN Git Service

* gcc.dg/tree-ssa/fre-vce-1.c: Cleanup "fre" tree dump.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / call-diag-2.c
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 "-pedantic-errors" } */
5
6 const void f_cv (void);
7 struct s f_s (void);
8 void f_v (void);
9
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 *-*-* } 12 } */
14 /* { dg-message "will abort" "abort" { target *-*-* } 12 } */
15 void g4 (void) { ((struct s (*) (void)) f_v) (), (void) 0; } /* { dg-error "invalid use of undefined type" } */
16 /* { dg-warning "function called through a non-compatible type" "cast" { target *-*-* } 15 } */
17 /* { dg-message "will abort" "abort" { target *-*-* } 15 } */