From: Tom Tromey Date: Tue, 27 Feb 2024 17:24:30 +0000 (-0700) Subject: Rely on std::uncaught_exceptions X-Git-Tag: binutils-2_43~548 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c12221171ba4851dff700f25ebc3cdbf120618a2;p=thirdparty%2Fbinutils-gdb.git Rely on std::uncaught_exceptions std::uncaught_exceptions is a C++17 feature, so I think we can remove this conditional code from inferior.h. --- diff --git a/gdb/inferior.h b/gdb/inferior.h index e239aa5b3cf..c08261bdcd3 100644 --- a/gdb/inferior.h +++ b/gdb/inferior.h @@ -86,13 +86,7 @@ struct infcall_suspend_state_deleter /* If we are restoring the inferior state due to an exception, some error message will be printed. So, only warn the user when we cannot restore during normal execution. */ - bool unwinding; -#if __cpp_lib_uncaught_exceptions - unwinding = std::uncaught_exceptions () > 0; -#else - unwinding = std::uncaught_exception (); -#endif - if (!unwinding) + if (std::uncaught_exceptions () == 0) warning (_("Failed to restore inferior state: %s"), e.what ()); } }