// PR tree-optimization/57661 // { dg-do compile { target c++11 } } // { dg-options "-O2 -fno-tree-forwprop" } template struct A { ~A () {} }; template using B = A <_Tp>; template class C : B <_Tp> {}; namespace N { enum D { d }; } template struct E { ~E (); }; template struct F : V {}; template struct G : F { N::D g1; void g2 (); void g3 (); void g4 () { g3 (); } static void g5 (G *__t) { __t->g4 (); } }; template struct H : G { E *h1; bool h2; ~H () throw () { this->g2 (); if (h2) delete h1; } }; template struct I : H , E { G *i; ~I () throw () { i->g4 (); } }; struct J { typedef C j1; typedef G > j2; J (); j2 *j3; }; struct K : J { typedef G > j2; K () { j2::g5 (this->j3); } }; template void G ::g3 () { switch (g1) { case N::d: { I *q = (I *) this; q->I ::~I (); } } } K r;