https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87513
--- Comment #7 from Martin Liška <marxin at gcc dot gnu.org> --- Reduced test-case: $ cat ice.ii template < int a > struct b { static constexpr int c = a; }; template < typename > struct d; template < typename > struct e; template < typename f, typename g > struct e< f g::* > : b< d< f >::c > {}; template < typename h, typename... i > struct d< h(i...) > : b< true > {}; template < typename > class j; struct k { typedef int l; }; template < bool, bool, typename... > struct m; template < typename ab, typename n, typename... o > struct m< false, true, ab, n, o... > : k {}; template < typename ac, typename... i > struct ad : m< b< false >::c, e< ac >::c, i... > {}; template < typename ac, typename... i > struct j< ac(i...) > : ad< ac, i... > {}; class p { public: p(char *); }; class q { public: template < long > void r(); }; class s { public: template < long t > auto ae(p) -> typename j< decltype (&q::r< t >)(q, p) >::l; }; using z = s; void f() { z ag; ag.ae< 0 >(""); }