// PR target/93187 // { dg-do compile { target c++11 } } // { dg-options "-O2" } // { dg-additional-options "-fstack-protector-strong" { target fstack_protector } } // { dg-additional-options "-fpie" { target pie } } struct A; struct B; struct C { int operator () (B, const B &); }; struct D { typedef int *d; }; struct E { C g; }; struct F { F (D::d); friend bool operator==(F &, const int &); }; template struct H { typedef D *I; E l; I foo (); T t; F bar (I, const T &); F baz (const T &); }; template F H::bar (I n, const T &o) { while (n) if (l.g (t, o)) n = 0; return 0; } template F H::baz (const T &n) { D *r = foo (); F p = bar (r, n); return p == 0 ? 0 : p; } template struct J { H h; B &q; void baz () { h.baz (q); } }; enum K { L }; template struct M; template struct G { using N = J; N *operator->(); }; template struct M : public G { using N = J; N *foo () { return n; } N *n; int o; }; template inline typename G::N * G::operator-> () { N *n = static_cast> *>(this)->foo (); return n; } struct B { bool qux (); }; struct O { struct P { M p; }; static thread_local P o; int baz () const; }; thread_local O::P O::o; B be; int O::baz () const { do o.p->baz (); while (be.qux ()); __builtin_unreachable (); }