From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9D9E3384475E; Mon, 20 Feb 2023 14:18:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9D9E3384475E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1676902684; bh=T7qjzPorD8KQJtlzSXfSfT30DYXqPnz2pG4He6P/fxE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ZaZfroQpSmpKELNy2Sg7ujl8HJOvQqpeuPL3DCueeOv1ZOETp2Tbh473wKGmNNfE/ 2NNWB6xpfQ/HzyNZ4w4x6w1EdC1VvwZJbRBCVhf5NQod5np230rfeMOH4HtTiaFge3 Ks6dm0EjM3dGclx52Dgb0Cvcy1GBUcWLsWQSHXL4= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/108829] [12/13 Regression] internal compiler error: in is_capture_proxy, at cp/lambda.cc:272 Date: Mon, 20 Feb 2023 14:18: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: 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 #6 from CVS Commits --- The trunk branch has been updated by Marek Polacek : https://gcc.gnu.org/g:02d8ab3e4e2f3d9dc12157a98c976d6698e71e29 commit r13-6141-g02d8ab3e4e2f3d9dc12157a98c976d6698e71e29 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.=