https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109876
--- Comment #11 from Marek Polacek <mpolacek at gcc dot gnu.org> --- We never instantiated fnc because mark_used checks /* Check this too in case we're within instantiate_non_dependent_expr. */ if (DECL_TEMPLATE_INFO (decl) && uses_template_parms (DECL_TI_ARGS (decl))) return true; and here uses_template_parms says yes because value_dependent_expression_p says 'a' is value-dep. Note we can't use in_template_function in v_d_e_p.