From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id BEA423858D31; Mon, 20 Apr 2020 03:30:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BEA423858D31 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1587353437; bh=vo/0hRk/mtQs//1U5z+AXzwCAKHzqMfkTz4ShiLEUGU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=kharyAlAdlvhfKU3ZOkbKzvrNHjsdupPFHyMXmZhVklvsJqXKObjiHE/alz3he+mq uE25zmmImN5dJt5Y50hnnRcALiBtc4HPmtWoU4mEyx6uo96LzYro5R7UXuXcwB5iMh F450jtqE7zzFBE/aQHaDXzWMtsxCj9j+rcz8r4fA= From: "mm-nospam at outlook dot co.nz" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/33799] Return value's destructor not executed when a local variable's destructor throws Date: Mon, 20 Apr 2020 03:30:37 +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: mm-nospam at outlook dot co.nz 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: 10.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Apr 2020 03:30:37 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D33799 mm-nospam at outlook dot co.nz changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mm-nospam at outlook dot c= o.nz --- Comment #14 from mm-nospam at outlook dot co.nz --- The bug still occurs for the same test case with the f() function modified = as such: X f() { try { X x(true); return X(false); } catch(...) { } return X(false); } The first X(false) is constructed and never destructed. This example also occurs in [except.ctor]/2 of the C++17 standard, note that since C++17 X's destructor should be marked as noexcept(false) in the test case.=