https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89766
--- Comment #10 from Rimvydas (RJ) <rimvydas.jas at gmail dot com> --- Using 9.0.1 20190319 as reference several ICE cases reduce down to the same snippet (regression on trunk)? $ cat trunk_accepts_invalid.ii class a { constexpr a(); }; template <class> struct b { static constexpr a c{}; }; Using different tactics other two (hopefully valid) testcases: $ cat vcontract.ii template <template <class> class a> struct b { template <class> static int c; using d = decltype(c<a>); }; template <typename> struct e { template <typename a, typename> bool f() const; template <typename, typename> bool f(int) const; }; $ cat vdefault.ii template <typename, template <typename, typename> class> struct a; template <template <typename, typename> class b> struct a<int, b>; template <typename> struct c { template <typename b, typename, typename> bool operator()(); template <typename, typename, typename d> bool operator()(d); };