From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1D4253858408; Tue, 26 Mar 2024 20:58:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1D4253858408 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1711486709; bh=Wrso/7rrvwkVB9nX22lDByV+yfRM3sHAvbzXH6bwn2g=; h=From:To:Subject:Date:In-Reply-To:References:From; b=MGm9nC2E93awrqVDgSwFFCjFgPe7wocgcnLjK94Zz9ThR+5ZqtlGMW13BJbcimmIz Klhmy39LjdwknYVA+jYHc2T4lRwAPEcCutpwHUCSNzxhL4SKZx3ZAG8ATsyWbW/QW7 K2Um770Ou5xU6NKiVnvVVDT/aIu98VkZBGOPkjaU= From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/114488] internal compiler error: unexpected expression static_cast ... Date: Tue, 26 Mar 2024 20:58:28 +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: 9.5.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: FIXED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D114488 --- Comment #4 from Jonathan Wakely --- On the gcc-9 branch the first bad commit is r9-8623-g0296697cf9893d commit 0296697cf9893dc9509cdcd8e3fd4ba9fe422527 Author: Jason Merrill Date: Mon May 25 18:38:09 2020 -0400 c++: constexpr and lambda capture [PR90212] This is the same issue as PR86429, just in potential_constant_expressio= n_1 rather than cxx_eval_constant_expression. As in that case, when we're trying to evaluate a constant expression within a lambda, we don't have= a constant closure object to refer to, but we can try to refer directly to the captured variable. PR c++/90212 * constexpr.c (potential_constant_expression_1): In a lambda function, consider a captured variable directly.=