Fortran: Fix PR 47485.
[gcc.git] / gcc / testsuite / g++.dg / warn / Wstrict-aliasing-float-ref-int-obj.C
blob9bc80c35585345627d81c57e301201bf78c0a1c2
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -Wstrict-aliasing -fstrict-aliasing" } */
5 int foo() {
6   int x;
7   float& q = reinterpret_cast<float&> (x); /* { dg-message "dereferencing type-punned" "deref" } */
8   /* { dg-message "initialized" "note" { xfail *-*-* } .-1 } */
9   
10   q = 1.0; /* { dg-warning "does break strict-aliasing" "strict-aliasing" { xfail *-*-* } } */
11   return x;