Niall Douglas wrote:
If you diagnose the test failures (which are present across all compilers) in https://www.boost.org/development/tests/develop/developer/outcome.html which report failures of the form:
``` unknown location(0): fatal error: in "works_outcome": Throw location unknown (consider using BOOST_THROW_EXCEPTION) Dynamic exception type: struct boost::wrapexcept<class boost::exception_ptr>
libs\outcome\test\tests\core-outcome.cpp(173): last checkpoint
*** 1 failure is detected in the test module "Outcome" ```
The cause is test code such as:
``` boost::system::error_code ec(5, boost::system::system_category()); auto e = boost::copy_exception(boost::system::system_error(ec)); // NOLINT outcome<int> m(e); BOOST_CHECK_THROW(m.value(), boost::system::system_error); ```
Outcome calls boost::rethrow_exception() to rethrow the exception_ptr. boost::rethrow_exception() is not rethrowing the boost::system::system_error held within the boost::exception_ptr. It is throwing instead boost::wrapexcept<class boost::exception_ptr>. This causes BOOST_CHECK_THROW() to not correctly trap the type of exception thrown, and thus the test fails.
The same example without use of outcome works:
#include