From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C519839874F0; Sat, 30 May 2020 04:21:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C519839874F0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1590812463; bh=hkWs3fD7/AylZxla87rIYliv9W3l8vTovPjd+O0FcKo=; h=From:To:Subject:Date:In-Reply-To:References:From; b=X3M0YP7EWEqafz1P5jGQykV2gLNKAMJD9ClTCWGa6XVx4ZrPZZq7wctmV6F/QVApw Xh+BL4GgfpBrMB3yocsJ2TZJ4MWgAmGSh3e8R7GJ07FDhejr43Fr/cjsWMVH6VFj5s eTadUQHiLwg97Hl2cslBmknJ8TFP5lhlCanZU0Ec= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/94128] ICE on C++20 "requires requires" with lambda Date: Sat, 30 May 2020 04:21:03 +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: 10.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: ppalka at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- 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: Sat, 30 May 2020 04:21:04 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D94128 --- Comment #4 from CVS Commits --- The releases/gcc-10 branch has been updated by Patrick Palka : https://gcc.gnu.org/g:03c344ad180e094140be514a5e7cbaf95b5dcd2e commit r10-8214-g03c344ad180e094140be514a5e7cbaf95b5dcd2e Author: Patrick Palka Date: Fri May 29 14:17:02 2020 -0400 c++: lambdas inside constraints [PR92652] When parsing a constraint-expression, a requires-clause or a requires-expression, we temporarily increment processing_template_decl so that we always obtain template trees which we could later reduce via substitution even when not inside a template. But incrementing processing_template_decl when we're already inside a template has the unintended side effect of shifting up the template parameter levels of a lambda defined inside one of these constructs, which leads to confusion later during substitution into the lambda. This patch fixes this issue by incrementing processing_template_decl during parsing of these constructs only if it is 0. gcc/cp/ChangeLog: PR c++/92652 PR c++/93698 PR c++/94128 * parser.c (cp_parser_requires_clause_expression): Temporarily increment processing_template_decl only if it is 0. (cp_parser_constraint_expression): Likewise. (cp_parser_requires_expression): Likewise. gcc/testsuite/ChangeLog: PR c++/92652 PR c++/93698 PR c++/94128 * g++.dg/cpp2a/concepts-lambda8.C: New test. * g++.dg/cpp2a/concepts-lambda9.C: New test. * g++.dg/cpp2a/concepts-lambda10.C: New test. (cherry picked from commit 020d86db8896f088435830595640e6fc21bc64ad)=