From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id DAE3C3858D32; Wed, 15 Nov 2023 20:03:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DAE3C3858D32 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1700078621; bh=+n/dtUyibOJu8u64y8ZDC65ljd60v2DMBdcSrBTObYA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=sOdSzdpjRyVOOvvPE544R79g41sL36Iyn5Suk8DQ10zoBA/Vzxy6ZPOAruGKN6CKh VGLEssht8bE4U7Eu6EK/70N2/i+vz4+C3rPDFFYTyyaQNdJ5zwbmJSzkRlDDkBCJ+e GrKhqnwRXN0o22C2DGeMVJ9HOLCguXKl/Vy/Gg1o= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/112553] noexcept lambda does not generate call to terminate Date: Wed, 15 Nov 2023 20:03:41 +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.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: INVALID 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: resolution bug_status 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=3D112553 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |INVALID Status|UNCONFIRMED |RESOLVED --- Comment #1 from Andrew Pinski --- ``` #include [[gnu::noipa, gnu::noinline]] void do_something() { throw 1; } void bar(){ []() noexcept{ do_something(); }(); } int main() { try { bar(); }catch(...) { printf("incorrectly caught eh.\n"); } } ``` Works as expected and std::terminate gets called. I don't see a reason to directly call std::terminate here if it is going to= be called from the personality function. The original issue where this would be an issue was fix a while back. Anywa= ys at -O1 tail calls are not enabled even so you can't run into the original issue. See PR 82081 also.=