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.
This commit is contained in:
Tom Tromey 2024-02-27 10:24:30 -07:00
parent d3f6bbc48d
commit c12221171b

View File

@ -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 ());
}
}