diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/transparent-union-4.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/transparent-union-4.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/transparent-union-4.c b/gcc/testsuite/gcc.dg/transparent-union-4.c new file mode 100644 index 000000000..f661cf2cb --- /dev/null +++ b/gcc/testsuite/gcc.dg/transparent-union-4.c @@ -0,0 +1,9 @@ +/* Test for ICE on transparent union with function pointer and + -pedantic. Bug 22240. */ +/* Origin: Joseph Myers <joseph@codesourcery.com> */ +/* { dg-do compile } */ +/* { dg-options "-pedantic" } */ + +typedef union { union w *u; int *i; } H __attribute__ ((transparent_union)); +void (*h) (H); +void g (int *s) { h (s); } /* { dg-warning "ISO C prohibits argument conversion to union type" } */ |