blob: d88ed4314b33dba13a5c831fd14c77b5bbb77657 [file] [log] [blame]
/* { dg-do compile } */
/* { dg-options "-O2 -Wstrict-aliasing -fstrict-aliasing" } */
int foo() {
int x;
float& q = reinterpret_cast<float&> (x); /* { dg-message "initialized" } */
q = 1.0; /* { dg-warning "does break strict-aliasing" } */
return x;
}
/* { dg-message "dereferencing type-punned" "" { target *-*-* } 7 } */