]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Rely on std::uncaught_exceptions
authorTom Tromey <tromey@adacore.com>
Tue, 27 Feb 2024 17:24:30 +0000 (10:24 -0700)
committerTom Tromey <tromey@adacore.com>
Tue, 4 Jun 2024 15:49:27 +0000 (09:49 -0600)
std::uncaught_exceptions is a C++17 feature, so I think we can remove
this conditional code from inferior.h.

gdb/inferior.h

index e239aa5b3cf08c61bd50e7fa12306df3a7730ece..c08261bdcd3e3cc9a8d68ef4feb35a7655b50486 100644 (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 ());
       }
   }