https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119447
--- Comment #3 from Patrick Palka <ppalka at gcc dot gnu.org> --- That approach seems reasonable to me FWIW. Alternatively maybe we could fall back to using the dependent DECL_CONTEXT (gen_tmpl) as 'ctx' if tsubst_entering_scope fails.