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

--- Comment #6 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Jason Merrill <[email protected]>:

https://gcc.gnu.org/g:5f39aa74f2217e04d2868f2110523b2a0ed41165

commit r16-6277-g5f39aa74f2217e04d2868f2110523b2a0ed41165
Author: Jason Merrill <[email protected]>
Date:   Fri Dec 19 15:20:13 2025 +0700

    c++: lambda template arg in abbreviated template [PR117034]

    A lambda used as a non-type template argument to a type-constraint in the
    first parameter of an abbreviated function template was wrapped in a
    TARGET_EXPR because we hadn't opened the implicit template scope yet. After
    r16-5115 changed convert_template_argument to call
    instantiate_non_dependent_expr_internal on non-dependent expressions, these
    TARGET_EXPRs began hitting the default case in tsubst_expr, causing an ICE.
    So let's enter implicit template scope as soon as we see the concept-name;
    at that point we know we're declaring an abbreviated template.

            PR c++/117034

    gcc/cp/ChangeLog:

            * parser.cc (maybe_start_implicit_template): Split out from...
            (synthesize_implicit_template_parm): ...here.
            (cp_parser_template_id): Call it.

    gcc/testsuite/ChangeLog:

            * g++.dg/cpp2a/lambda-template-pr117034.C: New test.

    Co-authored-by: Egas Ribeiro <[email protected]>

Reply via email to