From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id BFB193875430; Fri, 17 Nov 2023 00:21:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BFB193875430 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1700180489; bh=mzGcRC6prhFiin4WhGD+mFEs90Fwa0fyG57tzHeNCkg=; h=From:To:Subject:Date:In-Reply-To:References:From; b=IJWmsUHQsTvM+c2V2jRZ23BWevc8tlfQ4xto6aWZp8XEs4ggC4ROIDih8OkquhSaI B1Q+qUTXlGjTevOWk7M8oMXv1O4Zin50c6/pBiu6+GQQXNbEOZKz04tAIAdRr7hG0b jGqmlYPjp8Gs3o6dhz8fdPRQRGj7kvFaYMp0MBes= 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: Fri, 17 Nov 2023 00:21:09 +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 #24 from CVS Commits --- The releases/gcc-12 branch has been updated by Jason Merrill : https://gcc.gnu.org/g:65388a996d7dfcdd22ff2d191458699d1cacf254 commit r12-9988-g65388a996d7dfcdd22ff2d191458699d1cacf254 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.=