[Bug c++/124490] wrong "use of before deduction" with expansion statements

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Mar 20 11:33:27 GMT 2026


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124490

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ppalka at gcc dot gnu.org

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Though, I'm afraid it is more complicated than that.  I bet we need to treat
lambdas parsed when in_expansion_stmt && !processing_template_decl as if they
were lambdas inside of a template, but what exactly is needed to achieve that,
no idea.

E.g. that decl_dependent_p uses
  if (tree tinfo = get_template_info (decl))
    if (any_dependent_template_arguments_p (TI_ARGS (tinfo)))
      return true;
so at least for the case where for !processing_template_decl the expansion stmt
range_decl is undeduced when parsing the body, it would be good to have
get_template_info on the nested lambdas inside of it.


More information about the Gcc-bugs mailing list