https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112553
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |INVALID Status|UNCONFIRMED |RESOLVED --- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- ``` #include <stdio.h> [[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. Anyways at -O1 tail calls are not enabled even so you can't run into the original issue. See PR 82081 also.