From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 381F83858C5E; Mon, 5 Feb 2024 13:19:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 381F83858C5E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1707139166; bh=lQcLrPcO5B0KWP89tT+qZ5GOnJ9hOYq71xG+SfXhCUQ=; h=From:To:Subject:Date:From; b=acanV95DZmF/fNk9/ZmAHXCGVUl+VWWMuM46o2C+Ij158DPb72gkEydhGcLXorqcN +o8v+BIWGaZJZyFTHXIOzbT3OnfDuUexFmAR6zgKOlinKbGMoKD5zfugcUjcCrNZFA Danj8AnNn+4N+rouCY9XplI+yvl7CkkTX2Ft5bbM= From: "joerg.richter@pdv-fs.de" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/113767] New: Missing Destructor Call with goto and return value Date: Mon, 05 Feb 2024 13:19:25 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 13.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: joerg.richter@pdv-fs.de 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=3D113767 Bug ID: 113767 Summary: Missing Destructor Call with goto and return value Product: gcc Version: 13.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: joerg.richter@pdv-fs.de Target Milestone: --- #include struct S { S() { printf( "Cons\n" ); } ~S() { printf( "Dest\n" ); } }; S func() { bool first =3D true; restart: S ss; if( first ) { first =3D false; goto restart; } return ss; } int main() { func(); } Output: Cons Cons Dest Expected Output: Cons Dest Cons Dest https://godbolt.org/z/9n6nnv18P Seems to be fixed in trunk but not on any released branch. Can the fix be integrated to the released branches?=