From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 441883858422; Tue, 8 Feb 2022 13:48:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 441883858422 From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/103706] [11/12 Regression] ICE: tree check: accessed elt 1 of 'tree_vec' with 0 elts in hash, at cp/constraint.cc:2503 Date: Tue, 08 Feb 2022 13:48:26 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.3 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Feb 2022 13:48:26 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D103706 --- Comment #7 from CVS Commits --- The master branch has been updated by Patrick Palka : https://gcc.gnu.org/g:db5f1c17031ad8a898d77121f1e0e0141306e22a commit r12-7102-gdb5f1c17031ad8a898d77121f1e0e0141306e22a Author: Patrick Palka Date: Tue Feb 8 08:46:32 2022 -0500 c++: lambda in pack expansion using pack in constraint [PR103706] Here when expanding the pack expansion pattern containing a constrained lambda, the template argument for each Ts is an ARGUMENT_PACK_SELECT, which we store inside the lambda's LAMBDA_EXPR_REGEN_INFO. Then during satisfaction of the lambda's constraint C the satisfaction cache uses this argument as part of the key to the corresponding sat_entry, b= ut iterative_hash_template_arg and template_args_equal deliberately don't handle ARGUMENT_PACK_SELECT. Since it's wrong to preserve ARGUMENT_PACK_SELECT inside a hash table due to its instability (as documented in iterative_hash_template_arg), this patch helps make sure the satisfaction cache doesn't see such trees by resolving ARGUMENT_PACK_SELECT arguments before adding them to LAMBDA_EXPR_REGEN_INFO. PR c++/103706 gcc/cp/ChangeLog: * pt.cc (preserve_args): New function. (tsubst_lambda_expr): Use it when setting LAMBDA_EXPR_REGEN_INF= O. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/concepts-lambda19.C: New test.=