Commit 3a35cb3d by Derek Mauro Committed by Copybara-Service

Fix throw_delegate_test when using libc++ with shared libraries

PiperOrigin-RevId: 487707178
Change-Id: Ie8f57a6327a6460ab37566b8b6f56d470f6dd2dc
parent 44bb8045
......@@ -151,7 +151,21 @@ TEST(ThrowDelegate, ThrowStdUnderflowErrorString) {
}
TEST(ThrowDelegate, ThrowStdBadFunctionCallNoWhat) {
ExpectThrowNoWhat<std::bad_function_call>(ThrowStdBadFunctionCall);
#ifdef ABSL_HAVE_EXCEPTIONS
try {
ThrowStdBadFunctionCall();
FAIL() << "Didn't throw";
} catch (const std::bad_function_call&) {
}
#ifdef _LIBCPP_VERSION
catch (const std::exception&) {
// https://reviews.llvm.org/D92397 causes issues with the vtable for
// std::bad_function_call when using libc++ as a shared library.
}
#endif
#else
EXPECT_DEATH_IF_SUPPORTED(ThrowStdBadFunctionCall(), "");
#endif
}
TEST(ThrowDelegate, ThrowStdBadAllocNoWhat) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment