From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id BAC4D3858C3A; Thu, 12 Oct 2023 07:29:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BAC4D3858C3A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1697095773; bh=5gnSf4UKtl9+9f5/FjAskJh9/+CqdMxwUCaAmNd4oc8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=dnowrK5plKOLzMnHK7fV8iMeFjRoVWQdCKDj87PzTnCOPBUczUnP66lB5G35Nmh1x WJRVD4RANesTXLyWpV7krjnv+rI7xmDi7E9U0bgGfPhZT5Eu4OE+68o0mXZ8QEbu76 icjT+Uq89LWF47OdpnzfXBcLuGk0kdr8dtaPavBQ= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/111771] Incorrect "is used uninitialized" warning, as if zero-initialization didn't propagate through user-provided default constructors Date: Thu, 12 Oct 2023 07:29:33 +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.0 X-Bugzilla-Keywords: diagnostic, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: NEW 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: everconfirmed cf_reconfirmed_on keywords bug_status cc cf_known_to_fail 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=3D111771 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Last reconfirmed| |2023-10-12 Keywords| |diagnostic, wrong-code Status|UNCONFIRMED |NEW CC| |jason at gcc dot gnu.org Known to fail| |13.2.1, 7.5.0 --- Comment #3 from Richard Biener --- We have int main () { int D.2848; { struct B b; try { b.D.2778.x =3D 0; B::B (&b); D.2848 =3D b.D.2778.x; return D.2848; but: void B::B (struct B * const this) { _1 =3D &this->D.2778; A::A (_1); } void A::A (struct A * const this) { *this =3D {CLOBBER}; so A::A invoked by B::B invalidates the initialized storage. Maybe a "different" B::B should have been called (one not invoking A::A?).=