On Mon, Aug 25, 2025 at 11:55:24AM -0400, Patrick Palka wrote:
> > The following patch fixes that by testing DECL_TEMPLATE_INFO, dunno
> > what else would be more appropriate for this function is a template,
> > maybe decl_dependent_p?
>
> I was going to suggest just replacing the !processing_template_decl check
> with !in_template_context to distinguish a true template context but that
> wouldn't work here because we also push a dummy template parameter list
> when parsing an expansion statement... so failing that, your current
> approach makes sense to me.
Based on Jason's comment on the PARM_DECL tsubst_expr patch, another
possibility is !uses_template_params (fco), either always, or
in
if (!processing_template_decl
|| (in_expansion_stmt && !uses_template_parms (fco)))
form.
Jakub