From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6F02C3858D28; Sun, 31 Mar 2024 10:25:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6F02C3858D28 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1711880754; bh=AGD/9wexLBAZRpmuQOmv1cunzeqD7RFk/T2T0LSCjj4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=nhrmOcrza1R4Y5nPnc18s34W57DqLzb9Ls6pPl/THs/TlcfXhGErK1J0y9hOPgVCk gSE22sxx0ukP0qyU4QkS1Q+k3Y2pxuChhkkjIPaXzUhZwf3EL3e/oewnwUcJ9jNmU5 y31r3Ycjj87qIp38kwkdH3Wd2MiRsfIx/yefOj7o= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/114536] wrong constant evaluation of std::bit_cast for bit fields Date: Sun, 31 Mar 2024 10:25:54 +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: 13.2.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: 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=3D114536 --- Comment #3 from Andrew Pinski --- (In reply to Fedor Chelnokov from comment #2) > May be just fail constant evaluation then instead of evaluating it to 0? I suspect gcc is not rejecting it because the struct is just one unsigned c= har and it is getting confused between that and the unsigned char.=