Source code

Revision control

Copy as Markdown

Other Tools

From: Michael Froman <mfroman@mozilla.com>
Date: Thu, 20 Oct 2022 16:14:00 +0000
Subject: Bug 1795982 - pt3 - re-enable building absl/base:throw_delegate for
missing ThrowStdOutOfRange. r=ng
More code in the new libwebrtc/third_party update uses throw_delegate, which
until now we've been able to carefully avoid. However, in most cases, it
appears that ABSL_HAVE_EXCEPTIONS is turned off. This is good because throwing
exceptions isn't enabled, but upstream aborts instead. A static_assert was
added in throw_delegate.cc to verify that no exceptions can be thrown.
---
abseil-cpp/absl/base/internal/throw_delegate.cc | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/abseil-cpp/absl/base/internal/throw_delegate.cc b/abseil-cpp/absl/base/internal/throw_delegate.cc
index 337e870cd68..11467e08b41 100644
--- a/abseil-cpp/absl/base/internal/throw_delegate.cc
+++ b/abseil-cpp/absl/base/internal/throw_delegate.cc
@@ -26,6 +26,10 @@ namespace absl {
ABSL_NAMESPACE_BEGIN
namespace base_internal {
+#ifdef ABSL_HAVE_EXCEPTIONS
+static_assert(false, "Mozilla - ABSL_HAVE_EXCEPTIONS has been turned on");
+#endif
+
// NOTE: The exception types, like `std::logic_error`, do not exist on all
// platforms. (For example, the Android NDK does not have them.)
// Therefore, their use must be guarded by `#ifdef` or equivalent.