From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1A2D93858C53; Fri, 8 Dec 2023 18:34:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1A2D93858C53 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1702060493; bh=wFQbmey0bk85yt3x1iB7JMQKje9+cXBGVxYboD5RyJs=; h=From:To:Subject:Date:In-Reply-To:References:From; b=MjdGFFnQC2KzBccoINCA+PcDAQ6zZ+oH6M6aRtxqzYGxbJW6h+1/fq1e6oADeyb3E 29jY9pv4SLGEUJgpVSApqhrXtbnto7JqY/fzn4unjheddGDFkTFWA1FoPAtMclLk6z OczqXrLigLyhGDkWrzwsf667o4KSakxBzm7O0HEw= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/94264] Array-to-pointer conversion not performed on array prvalues Date: Fri, 08 Dec 2023 18:34:51 +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.3.0 X-Bugzilla-Keywords: rejects-valid 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: jason 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=3D94264 --- Comment #9 from GCC Commits --- The master branch has been updated by Patrick Palka : https://gcc.gnu.org/g:5764825aed613f201a8bc47e5b239027a39691f0 commit r14-6342-g5764825aed613f201a8bc47e5b239027a39691f0 Author: Patrick Palka Date: Fri Dec 8 13:33:55 2023 -0500 c++: undiagnosed error_mark_node from cp_build_c_cast [PR112658] When cp_build_c_cast commits to an erroneous const_cast, we neglect to replay errors from build_const_cast_1 which can lead to us incorrectly accepting (and "miscompiling") the cast, or triggering the assert in finish_expr_stmt. This patch fixes this oversight. This was the original fix for the ICE in PR112658 before r14-5941-g305a2686c99bf9 made us accept the testcase there after all. I wasn't able to come up with an alternate testcase f= or which this fix has an effect anymore, but below is a reduced version of the PR112658 testcase (accepted ever since r14-5941) for good measure. PR c++/112658 PR c++/94264 gcc/cp/ChangeLog: * typeck.cc (cp_build_c_cast): If we're committed to a const_ca= st and the result is erroneous, call build_const_cast_1 a second time to issue errors. Use complain=3Dtf_none instead of =3Dfal= se. gcc/testsuite/ChangeLog: * g++.dg/cpp0x/initlist-array20.C: New test.=