From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0E0303856DC8; Fri, 30 Jun 2023 07:49:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0E0303856DC8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1688111353; bh=/FqYptmn/TGTqp67o268SdTNuLglFauRgJuFvjX7e9A=; h=From:To:Subject:Date:In-Reply-To:References:From; b=pUSOFehH4mqnVuqODVKXIsQF9yYhaWlOHhejUie/zTvWws4tA5EHRqXWH9zrvRIo5 71ZYE6AkipcZ4dycUnj4YBiTw3QTOomKaewo+zCui0d6i5ER0STtKg1pkT4vfamuZh A7jBNbdsSc7zYHN36ewig8OrVPjZeV/kK5XoewNE= From: "ed at catmur dot uk" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/110493] 'is not a constant expression' for function-local static std::initializer_list with fsanitize=undefined Date: Fri, 30 Jun 2023 07:49:12 +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.3.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ed at catmur dot uk 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=3D110493 --- Comment #4 from Ed Catmur --- Ah, thanks. So a workaround is something like: void f() { static auto a =3D {((bool*)&(int const&)0, std::string())}; } That's not too bad, then.=