Fortran: Fix PR 47485.
[gcc.git] / gcc / testsuite / g++.dg / warn / Wstrict-aliasing-bogus-tmpl.C
blobd0375042e42299da2b54829ee20cc3ec9888683a
1 // PR c++/94951
2 // { dg-do compile }
3 // { dg-options "-O2 -Wall" }
5 struct A { int a; };
6 template <int N>
7 struct B : public A
9   static B<N> foo () { B<N> t; t.a = 4; return t; }     // { dg-bogus "dereferencing type-punned pointer will break strict-aliasing rules" }
12 B<0> b = B<0>::foo ();