diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 00af2c42833..aa0123502c7 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-04-30 Marek Polacek + + PR tree-optimization/63551 + * g++.dg/ipa/pr63551.C: New test. + 2015-04-30 Caroline Tice PR 65929 diff --git a/gcc/testsuite/g++.dg/ipa/pr63551.C b/gcc/testsuite/g++.dg/ipa/pr63551.C new file mode 100644 index 00000000000..03e03397969 --- /dev/null +++ b/gcc/testsuite/g++.dg/ipa/pr63551.C @@ -0,0 +1,23 @@ +// { dg-options "-O -Wno-psabi" } +// { dg-do compile } + +struct A { int a; }; +template struct B { V operator[] (T); }; +union U { long double ld; void *v; }; +A a; + +void +bar (U &x) +{ + if (x.v) *reinterpret_cast (x.v) = a; +} + +struct C { C (A) { c.ld = 0; bar (c); } U c; }; +struct D { A d, e; void foo () { f[0][d] = e; } B > f; }; + +void +baz () +{ + D d; + d.foo (); +}