Sign in
gnu
/
gcc
/
1f16a020acbea0af26209478990b83b1a1ba3a2b
/
.
/
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
;
}