Sign in
gnu
/
gcc
/
d769c5040874bf9546f2524f3f1d2a894165f92a
/
.
/
gcc
/
testsuite
/
g++.dg
/
warn
/
Wstrict-aliasing-bogus-union.C
blob: dfbb42c6fd5d2db1c9fed0c70da2db4b5c414bfc [
file
] [
log
] [
blame
]
/* { dg-do compile } */
/* { dg-options "-O2 -Wstrict-aliasing -fstrict-aliasing" } */
union
U
{
int
i
;
float
f
;
};
float
foo
()
{
union
U u
;
float
*
f
=
&
u
.
f
;
/* { dg-bogus "unions are holy in GCC" } */
u
.
i
=
2
;
return
*
f
;
}