Commit de428b41 authored by Yedidya Feldblum's avatar Yedidya Feldblum Committed by Facebook GitHub Bot

fix folly/lang/ExceptionTest.cpp under libc++

Summary: Fix the uncaught-exception termination message expectations in `folly/lang/ExceptionTest.cpp` under libc++.

Reviewed By: markisaa

Differential Revision: D26328622

fbshipit-source-id: 2e2f9fce93c65556508d99d1f7b80f0971f35c0c
parent 94e80675
......@@ -50,12 +50,12 @@ extern "C" FOLLY_KEEP void check_cond_folly_terminate_with(bool c) {
template <typename Ex>
static std::string message_for_terminate_with(std::string const& what) {
auto const name = folly::pretty_name<Ex>();
auto const prefix =
std::string("terminate called after throwing an instance of ");
std::string const p0 = "terminate called after throwing an instance of";
std::string const p1 = "terminating with uncaught exception of type";
// clang-format off
return
folly::kIsGlibcxx ? prefix + "'" + name + "'\\s+what\\(\\):\\s+" + what :
folly::kIsLibcpp ? prefix + name + ": " + what :
folly::kIsGlibcxx ? p0 + " '" + name + "'\\s+what\\(\\):\\s+" + what :
folly::kIsLibcpp ? p1 + " " + name + ": " + what :
"" /* empty regex matches anything */;
// clang-format on
}
......
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