// PR tree-optimization/79267 // { dg-do compile } // { dg-options "-O3" } struct A { A (int); }; struct B { virtual void av () = 0; void aw (); void h () { av (); aw (); } }; template struct G : B { T ba; G (int, T) : ba (0) {} void av () { ba (0); } }; struct I { B *bc; template I (j, T) try { G (0, 0); } catch (...) {} ~I () { bc->h (); } }; template struct C { typedef M *i; }; template struct J { J (); template J (O, T p2) : be (0, p2) {} typename C::i operator-> (); I be; }; struct H : A { H () : A (0) {} }; struct D { J d; void q (); }; template class bs; int z; void foo (int p1, int *, int) { if (p1 == 0) throw H (); } D bar (); template struct L { struct K { K (int); void operator() (int *) { bar ().q (); } }; static J bp () { bq (0); return J(); } template static void bq (br) { J (0, K (0)); } }; struct F { virtual J x (int) { foo (0, 0, 0); J > (L >::bp ()); return J(); } }; void baz () { if (z) { J d, e; d->x (0); e->x (0); } J v, i, j; v->x (0); i->x (0); j->x (0); }