https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98939
--- Comment #3 from Jason Merrill <jason at gcc dot gnu.org> --- (In reply to Marek Polacek from comment #2) > class C { > template <typename...> struct _List; > > template <unsigned long, typename, bool B = value> struct S; // #1 > > template <unsigned long _Sz, typename _Uint, typename... _UInts> > struct S<_Sz, _List<_Uint, _UInts...>>; // #2 > > static constexpr bool value = false; > }; > > #2 wants to lookup_template_class S, but S can contain a DEFERRED_PARSE, so > that's not going to work. Perhaps we have to delay finish_template_type > until the end of class somehow... As I was saying in our meeting, I think in this testcase #2 is ill-formed because it depends on a default argument that hasn't been parsed yet.