From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 96E043856DDA; Wed, 7 Jun 2023 01:33:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 96E043856DDA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1686101613; bh=5KUX/OMsKMGvGDN010YKGgSbK6bhaOYDJ/JC0yh7c0c=; h=From:To:Subject:Date:In-Reply-To:References:From; b=p8rGAu+Ys2dijAXtD5L9nWBalhvlqiCgDkBtQHB3SDLf6ewDGuTehjtwB6SO2p7Qb mPVnWLHZjPOwShGNF34mLxa76/SXeT+oZa+CVWyKtO27jrvp+jmjh9956YfYgDpBts ZkSKNEEejDXQfBle0GAyPx/Qph9/yCLlmySp/F5M= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/33799] Return value's destructor not executed when a local variable's destructor throws Date: Wed, 07 Jun 2023 01:33:31 +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: 4.2.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: major X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: FIXED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: jason at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.0 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=3D33799 --- Comment #22 from CVS Commits --- The trunk branch has been updated by Jason Merrill : https://gcc.gnu.org/g:08cea4e56a094ff9cc7c65fdc9ce8c4d7aff64be commit r14-1591-g08cea4e56a094ff9cc7c65fdc9ce8c4d7aff64be Author: Jason Merrill Date: Tue Jun 6 15:31:23 2023 -0400 c++: fix throwing cleanup with label While looking at PR92407 I noticed that the expectations of maybe_splice_retval_cleanup weren't being met; an sk_cleanup level was confusing its attempt to recognize the outer block of the function. And even if I fixed the detection, it failed to actually wrap the body of t= he function because the STATEMENT_LIST it got only had the label, not anyt= hing after it. So I moved the call after poplevel does pop_stmt_list on all= the sk_cleanup levels. PR c++/33799 gcc/cp/ChangeLog: * except.cc (maybe_splice_retval_cleanup): Change recognition of function body and try scopes. * semantics.cc (do_poplevel): Call it after poplevel. (at_try_scope): New. * cp-tree.h (maybe_splice_retval_cleanup): Adjust. gcc/testsuite/ChangeLog: * g++.dg/eh/return1.C: Add label cases.=