// PR c++/87539 // { dg-do compile { target c++11 } } // { dg-options "-Os" } namespace a { template class c; class exception {}; template struct e { d f; }; struct g { g(); g(const g &); }; } template class h; template struct i; template struct aa { static const int k = j; }; struct ac { typedef a::e l; }; struct ad; template struct ae { typedef m l; }; template struct ae { typedef n l; }; template struct o { typedef typename ae::l l; }; struct af { af(char *); }; template struct ag { ag(a::g = a::g()) {} }; template struct i, al> { typedef ag l; }; namespace ak { template struct ap { typedef typename o::l ::l l; }; template struct aq { typedef ad l; }; } template struct as { typedef char at; template static decltype(au(), at()) av(int); template static int av(...); static const bool k = sizeof(av(0)) == 1; }; template struct aw { static const bool k = as::k; }; template struct ax { typedef aw l; }; template struct ay { typedef typename ax::l l; }; template struct az : ay::l {}; template struct ba : aa::k> {}; template struct bb : ak::ap, ak::aq<>, int> {}; template struct q : ba::l, int> {}; template class r; template struct r { s operator*(); s operator++(); }; template class bc : public r>, int, q::k> {}; template int operator!=(bc, bc); template struct h { typedef af bl; bc, int, ac>::l, int> begin(); bc, int, ac>::l, int> end(); template bm bn() const; template int bo() const; template int bx(const bl &, const bm &) const; template int bp(const bl &) const; }; template template bm h::bn() const { typename i, bm>::l(); return bm(); } template template int h::bo() const { i, int>::l(); bn(); return 0; } template template int h::bx(const bl &bs, const bm &) const { bp(bs); return 0; } template template int h::bp(const bl &) const { bo(); return 0; } char bt[] = ""; void d() { h bu; for (auto bv : bu) try { bv.f.bx(bt, 0); } catch (a::exception) { } }