PR c/56980
[official-gcc.git] / gcc / testsuite / gcc.dg / pr56980.c
blobf48379a79ec2ba7abf17e242867f994f4f75a3da
1 /* PR c/56980 */
2 /* { dg-do compile } */
4 typedef struct A { int i; } B;
5 typedef union U { int i; } V;
6 typedef enum E { G } F;
8 void foo_s (struct A); /* { dg-message "expected .struct A. but argument is of type .B \\*." } */
9 void foo_u (union U); /* { dg-message "expected .union U. but argument is of type .V \\*." } */
10 void foo_e (enum E); /* { dg-message "expected .enum E. but argument is of type .F \\*." } */
11 void foo_sp (B *); /* { dg-message "expected .B \\*. but argument is of type .struct B \\*." } */
12 void foo_up (V *); /* { dg-message "expected .V \\*. but argument is of type .union V \\*." } */
13 void foo_ep (F *); /* { dg-message "expected .F \\*. but argument is of type .enum F \\*." } */
15 void
16 bar (B *b, V *v, F *f)
18 foo_s (b); /* { dg-error "incompatible" } */
19 foo_u (v); /* { dg-error "incompatible" } */
20 foo_e (f); /* { dg-error "incompatible" } */
21 foo_sp ((struct B *) b); /* { dg-error "passing argument" } */
22 foo_up ((union V *) v); /* { dg-error "passing argument" } */
23 foo_ep (__extension__ (enum F *) f); /* { dg-error "passing argument" } */