From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C89CF3858D35; Fri, 30 Jun 2023 04:29:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C89CF3858D35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1688099383; bh=A7EGfJB89NxgkHchM+XIl4BvKliKGfPvhxq6BeJSYUs=; h=From:To:Subject:Date:From; b=tpU9QaRsg1Y1e/zOHkjkJaMoY2jA74FYHT4hH9vLkSAyRjZ3aWx4Ps+JRLz8C/zy2 ud0DbwV9aV5uxus0B6cn4U0/ZzHg2pdBjcRkZLac9IU9DrMO3hKCEp3Y0DnGLJ5Nyn zIpkJjlXaahMZLBAUvXrY/+0HtTiikgbLqacx1K8= From: "ed at catmur dot uk" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/110493] New: 'is not a constant expression' for function-local static std::initializer_list with fsanitize=undefined Date: Fri, 30 Jun 2023 04:29:43 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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 Bug ID: 110493 Summary: 'is not a constant expression' for function-local static std::initializer_list with fsanitize=3Dundefined Product: gcc Version: 12.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: ed at catmur dot uk Target Milestone: --- Since 12.3.0, under -fsanitize=3Dundefined -std=3Dc++20: #include #include void f() { static auto a =3D {std::string()}; } error: '(((const std::__cxx11::basic_string*)(& )) !=3D 0)= ' is not a constant expression Clearly this is an instance of bug 71962, but this is in fairly unexception= al code and could make ubsan unusable; it's not obvious that this code should = have anything to do with constant evaluation. Since it only appears in a point release I would hope it might be possible = to fix in library for this specific case, within ?=