diff options
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.dg/transparent-union-2.c')
-rw-r--r-- | gcc-4.9/gcc/testsuite/gcc.dg/transparent-union-2.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/transparent-union-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/transparent-union-2.c new file mode 100644 index 000000000..adc207617 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/transparent-union-2.c @@ -0,0 +1,18 @@ +/* PR c/20043 */ +/* { dg-do compile } */ +/* { dg-options "-std=gnu99" } */ + +typedef union { int *i; long *l; } U + __attribute__((transparent_union)); + +extern void f0 (U); /* { dg-message "note: previous declaration" } */ +extern void f0 (void *); /* { dg-error "conflicting types" } */ + +extern void f1 (U); /* { dg-message "note: previous declaration" } */ +extern void f1 (unsigned long); /* { dg-error "conflicting types" } */ + +extern void f2 (void *); /* { dg-message "note: previous declaration" } */ +extern void f2 (U); /* { dg-error "conflicting types" } */ + +extern void f3 (unsigned long); /* { dg-message "note: previous declaration" } */ +extern void f3 (U); /* { dg-error "conflicting types" } */ |