Mark throw_exception with BOOST_NORETURN. Closes #12.

This commit is contained in:
Peter Dimov
2019-06-03 03:06:40 +03:00
parent 50c34dee24
commit 1e507924ce
3 changed files with 33 additions and 39 deletions

View File

@ -4,27 +4,24 @@
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#define BOOST_NO_EXCEPTIONS
#include <boost/throw_exception.hpp>
#include <boost/detail/lightweight_test.hpp>
#include <cstdlib>
class my_exception: public std::exception { };
class my_exception: public std::exception {};
bool called=false;
int main()
{
boost::throw_exception( my_exception() );
return 1;
}
namespace
boost
{
void
throw_exception( std::exception const & )
{
called=true;
}
}
namespace boost
{
int
main()
{
boost::throw_exception(my_exception());
BOOST_TEST(called);
return boost::report_errors();
}
void throw_exception( std::exception const & )
{
std::exit( 0 );
}
} // namespace boost