annotate gcc/testsuite/gcc.dg/call-diag-2.c @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* Test diagnostics for calling function returning qualified void or
kono
parents:
diff changeset
2 other incomplete type other than void. PR 35210. */
kono
parents:
diff changeset
3 /* { dg-do compile } */
kono
parents:
diff changeset
4 /* { dg-options "-std=gnu99 -pedantic-errors" } */
kono
parents:
diff changeset
5
kono
parents:
diff changeset
6 const void f_cv (void);
kono
parents:
diff changeset
7 struct s f_s (void);
kono
parents:
diff changeset
8 void f_v (void);
kono
parents:
diff changeset
9
kono
parents:
diff changeset
10 void g1 (void) { f_cv (); } /* { dg-error "qualified void" } */
kono
parents:
diff changeset
11 void g2 (void) { f_s (); } /* { dg-error "invalid use of undefined type" } */
kono
parents:
diff changeset
12 void g3 (void) { ((const void (*) (void)) f_v) (); } /* { dg-error "qualified void" } */
kono
parents:
diff changeset
13 /* { dg-warning "function called through a non-compatible type" "cast" { target *-*-* } .-1 } */
kono
parents:
diff changeset
14 void g4 (void) { ((struct s (*) (void)) f_v) (), (void) 0; } /* { dg-error "invalid use of undefined type" } */
kono
parents:
diff changeset
15 /* { dg-warning "function called through a non-compatible type" "cast" { target *-*-* } .-1 } */