https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81318
--- Comment #8 from Markus Trippelsdorf <trippels at gcc dot gnu.org> --- Reduced Boost testcase: struct A; struct B { typedef A *type; }; struct C { B::type operator->(); }; struct D { struct F { F(void(void *), F *, void()); }; template <typename FunT> struct J : F { FunT m_Function; J(FunT) : F(m_fn1, 0, 0) {} static void m_fn1(void *) { static_cast<J *>(0)->m_Function(); } }; F *m_pImpl; template <typename FunT> D(FunT p1) : m_pImpl(new J<FunT>(p1)) {} }; struct A { void m_fn2(D); }; struct G { void operator()() { throw; } }; struct H { void operator()() try { G()(); } catch (int) { } }; struct I { void operator()() { H()(); } }; void fn1() { I a; C b; b->m_fn2(a); }