forked from boostorg/throw_exception
Mark throw_exception with BOOST_NORETURN. Closes #12.
This commit is contained in:
@ -54,7 +54,7 @@ namespace boost
|
|||||||
{
|
{
|
||||||
#ifdef BOOST_NO_EXCEPTIONS
|
#ifdef BOOST_NO_EXCEPTIONS
|
||||||
|
|
||||||
void throw_exception( std::exception const & e ); // user defined
|
BOOST_NORETURN void throw_exception( std::exception const & e ); // user defined
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
@ -5,27 +5,24 @@
|
|||||||
|
|
||||||
#define BOOST_NO_EXCEPTIONS
|
#define BOOST_NO_EXCEPTIONS
|
||||||
#define BOOST_EXCEPTION_DISABLE
|
#define BOOST_EXCEPTION_DISABLE
|
||||||
|
|
||||||
#include <boost/throw_exception.hpp>
|
#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
|
namespace boost
|
||||||
boost
|
{
|
||||||
{
|
|
||||||
void
|
|
||||||
throw_exception( std::exception const & )
|
|
||||||
{
|
|
||||||
called=true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
void throw_exception( std::exception const & )
|
||||||
main()
|
{
|
||||||
{
|
std::exit( 0 );
|
||||||
boost::throw_exception(my_exception());
|
}
|
||||||
BOOST_TEST(called);
|
|
||||||
return boost::report_errors();
|
} // namespace boost
|
||||||
}
|
|
||||||
|
@ -4,27 +4,24 @@
|
|||||||
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
#define BOOST_NO_EXCEPTIONS
|
#define BOOST_NO_EXCEPTIONS
|
||||||
|
|
||||||
#include <boost/throw_exception.hpp>
|
#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
|
namespace boost
|
||||||
boost
|
{
|
||||||
{
|
|
||||||
void
|
|
||||||
throw_exception( std::exception const & )
|
|
||||||
{
|
|
||||||
called=true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
void throw_exception( std::exception const & )
|
||||||
main()
|
{
|
||||||
{
|
std::exit( 0 );
|
||||||
boost::throw_exception(my_exception());
|
}
|
||||||
BOOST_TEST(called);
|
|
||||||
return boost::report_errors();
|
} // namespace boost
|
||||||
}
|
|
||||||
|
Reference in New Issue
Block a user