OSDN Git Service

/cp
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / warn / Wstrict-aliasing-float-ref-int-obj.C
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -Wstrict-aliasing -fstrict-aliasing" } */
3
4
5 int foo() {
6   int x;
7   float& q = reinterpret_cast<float&> (x);  /* { dg-warning "type-punn" } */
8   q = 1.0;
9   return x;
10 }