Debian Codegraph @

gcc/testsuite/gcc.dg/noncompile/930714-1.c

raw
1 typedef union _yystype
2 {
3 int i;
4 int *iptr;
5 int (*ifunc)(int);
6 void (*vfunc)(int);
7 }
8 YYSTYPE;
9
10 extern int f1(int k);
11
12 void test()
13 {
14 YYSTYPE a;
15 int (*iptr)(int);
16 int foo[5];
17
18 a = f1; /* { dg-error "incompatible types" } */
19 a = (YYSTYPE)f1;
20 a = (YYSTYPE)foo;
21 a = (YYSTYPE)(int *)foo;
22 iptr = f1;
23 a = iptr; /* { dg-error "incompatible types" } */
24 a = (YYSTYPE)iptr;
25 }