From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D041D3858D39; Tue, 16 Apr 2024 08:02:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D041D3858D39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1713254548; bh=MAUAYxNi6goqkJj4bfBnehAndqkFu6028CyIlVikMtY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Uw9ns0a15PIDiLKK2WoqLxcZqvk0zSetNzRHsnBHps8qG8k6jXgY3sc0MV+KQLQeO Y0J0opgGtUYi0+copA579B/3CIgJyHWRGo7kJyF17Mqc2Yct0Rs+aeknWw6oLG7DRC T86xpqejXa85r/qaB5z+iejrNgjIkKGI1e9EpmOo= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/114706] ICE - std::bit_cast in consteval function involving array of union Date: Tue, 16 Apr 2024 08:02: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: 14.0 X-Bugzilla-Keywords: ice-on-invalid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: jakub 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=3D114706 --- Comment #4 from Jakub Jelinek --- The master branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:79ff53453e88e40c4f2ecf6f7f7409afc41b46fc commit r14-9987-g79ff53453e88e40c4f2ecf6f7f7409afc41b46fc Author: Jakub Jelinek Date: Tue Apr 16 09:39:19 2024 +0200 c++: Handle ARRAY_TYPE in check_bit_cast_type [PR114706] https://eel.is/c++draft/bit.cast#3 says that std::bit_cast isn't conste= xpr if To, From and the types of all subobjects have certain properties whi= ch the check_bit_cast_type checks (such as it isn't a pointer, reference, unio= n, member pointer, volatile). The function doesn't cp_walk_tree though, so I've missed one important case, for ARRAY_TYPEs we need to recurse on t= he element type. I think we don't need to handle VECTOR_TYPEs/COMPLEX_TYP= Es, because those will not have a pointer/reference/union/member pointer in the element type and if the element type is volatile, I think the whole derived type is volatile as well. 2024-04-16 Jakub Jelinek PR c++/114706 * constexpr.cc (check_bit_cast_type): Handle ARRAY_TYPE. * g++.dg/cpp2a/bit-cast17.C: New test.=