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

@ -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

View File

@ -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
}

View File

@ -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
}