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

--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Patrick Palka <ppa...@gcc.gnu.org>:

https://gcc.gnu.org/g:34ba3d9a2bf72742b1c150a2dd17d10e3e3f0964

commit r12-7101-g34ba3d9a2bf72742b1c150a2dd17d10e3e3f0964
Author: Patrick Palka <ppa...@redhat.com>
Date:   Tue Feb 8 08:46:13 2022 -0500

    c++: constrained auto in lambda using outer tparms [PR103706]

    Here we're crashing during satisfaction of the lambda's placeholder type
    constraints because the constraints depend on the template arguments
    from the enclosing scope, which aren't part of the lambda's DECL_TI_ARGS.

    This patch fixes this by making do_auto_deduction consider the
    "regenerating" template arguments of a lambda for satisfaction,
    mirroring what's done in satisfy_declaration_constraints.

            PR c++/103706

    gcc/cp/ChangeLog:

            * constraint.cc (satisfy_declaration_constraints): Use
            lambda_regenerating_args instead.
            * cp-tree.h (lambda_regenerating_args): Declare.
            * pt.cc (lambda_regenerating_args): Define, split out from
            satisfy_declaration_constraints.
            (do_auto_deduction): Use lambda_regenerating_args to obtain the
            full set of outer template arguments for satisfaction when
            inside a lambda.

    gcc/testsuite/ChangeLog:

            * g++.dg/cpp2a/concepts-lambda18.C: New test.

Reply via email to