Files
throw_exception/test/throw_exception_nx_test.cpp

31 lines
632 B
C++
Raw Permalink Normal View History

// Copyright 2019 Peter Dimov
// Distributed under the Boost Software License, Version 1.0.
// http://www.boost.org/LICENSE_1_0.txt
2019-12-08 19:33:48 +02:00
#if defined(_MSC_VER)
# pragma warning(disable: 4702) // unreachable code
# pragma warning(disable: 4577) // noexcept used without /EHsc
2021-09-30 20:44:56 +03:00
# pragma warning(disable: 4530) // C++ exception handler used
2019-12-08 19:33:48 +02:00
#endif
#include <boost/throw_exception.hpp>
#include <cstdlib>
class my_exception: public std::exception {};
int main()
{
boost::throw_exception( my_exception() );
return 1;
}
namespace boost
{
void throw_exception( std::exception const & )
{
std::exit( 0 );
}
} // namespace boost