1 // Copyright 2020 Peter Dimov 2 // Distributed under the Boost Software License, Version 1.0. 3 // http://www.boost.org/LICENSE_1_0.txt 4 5 #if defined(_MSC_VER) 6 # pragma warning(disable: 4702) // unreachable code 7 #endif 8 9 #define BOOST_EXCEPTION_DISABLE 10 11 #include <boost/exception_ptr.hpp> 12 #include <boost/core/lightweight_test.hpp> 13 14 class my_exception: public std::exception {}; 15 main()16int main() 17 { 18 BOOST_TEST_THROWS( boost::rethrow_exception( boost::make_exception_ptr( my_exception() ) ), my_exception ); 19 return boost::report_errors(); 20 } 21