From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D03813858D38; Mon, 20 Feb 2023 17:27:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D03813858D38 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1676914054; bh=b9V0vc1d34c/5tQjOQ3/gH3QXjWYKvkXzgEqso2PlhU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=LpwCfO+xMzb0Kh5rPv+rHIpnBcWp6KsUjGZ7nP0TEs44ncsowt264Ie21fVXtO0bN K5iCkIcrfG8Vp6KzurGrmYU5wkE5ia2Q07KvsyCnUzcb4efx+FmyJi2AR2WmovzJbv W7Rd9o3Vvsvgfb0vBQGKY53y8W7waNh+SSVzubXE= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/108829] [12 Regression] internal compiler error: in is_capture_proxy, at cp/lambda.cc:272 Date: Mon, 20 Feb 2023 17:27:34 +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.2.1 X-Bugzilla-Keywords: c++-lambda, ice-checking, 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: P2 X-Bugzilla-Assigned-To: mpolacek at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D108829 --- Comment #8 from CVS Commits --- The releases/gcc-12 branch has been updated by Marek Polacek : https://gcc.gnu.org/g:12cdc0e266f02c3ba4e80c3d971463ff507e049b commit r12-9191-g12cdc0e266f02c3ba4e80c3d971463ff507e049b Author: Marek Polacek Date: Thu Feb 16 17:41:24 2023 -0500 c++: ICE with redundant capture [PR108829] Here we crash in is_capture_proxy: /* Location wrappers should be stripped or otherwise handled by the caller before using this predicate. */ gcc_checking_assert (!location_wrapper_p (decl)); We only crash with the redundant capture: int abyPage =3D [=3D, abyPage] { ... } because prune_lambda_captures is only called when there was a default capture, and with [=3D] only abyPage won't be in LAMBDA_EXPR_CAPTURE_LI= ST. The problem is that LAMBDA_CAPTURE_EXPLICIT_P wasn't propagated correctly and so var_to_maybe_prune proceeded where it shouldn't. Co-Authored by: Patrick Palka PR c++/108829 gcc/cp/ChangeLog: * pt.cc (prepend_one_capture): Set LAMBDA_CAPTURE_EXPLICIT_P. (tsubst_lambda_expr): Pass LAMBDA_CAPTURE_EXPLICIT_P to prepend_one_capture. gcc/testsuite/ChangeLog: * g++.dg/cpp0x/lambda/lambda-108829-2.C: New test. * g++.dg/cpp0x/lambda/lambda-108829.C: New test. (cherry picked from commit 02d8ab3e4e2f3d9dc12157a98c976d6698e71e29)=