Skip to content

Commit

Permalink
Update contrib/restricted/boost/exception to 1.82.0
Browse files Browse the repository at this point in the history
  • Loading branch information
robot-piglet committed Apr 29, 2023
1 parent ee1c0ab commit 7c9f9f2
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ boost
inline
wrap_exception_ptr( std::exception_ptr const & e )
{
exception_detail::clone_base const & base =
boost::enable_current_exception(std_exception_ptr_wrapper(std::current_exception()));
exception_detail::clone_base const & base = boost::enable_current_exception(std_exception_ptr_wrapper(e));
return shared_ptr<exception_detail::clone_base const>(base.clone());
}
#endif
Expand Down Expand Up @@ -112,14 +111,24 @@ boost
}
};

namespace
exception_detail
{
template <class E>
inline
exception_ptr
copy_exception_impl( E const & e )
{
return exception_ptr(boost::make_shared<E>(e));
}
}

template <class E>
inline
exception_ptr
copy_exception( E const & e )
{
E cp = e;
exception_detail::copy_boost_exception(&cp, &e);
return exception_ptr(boost::make_shared<wrapexcept<E> >(cp));
return exception_detail::copy_exception_impl(boost::enable_current_exception(e));
}

template <class T>
Expand Down Expand Up @@ -385,6 +394,9 @@ boost
{
return exception_ptr(shared_ptr<exception_detail::clone_base const>(e.clone()));
}

#ifdef BOOST_NO_CXX11_HDR_EXCEPTION

catch(
std::domain_error & e )
{
Expand Down Expand Up @@ -457,19 +469,19 @@ boost
{
return exception_detail::current_exception_std_exception(e);
}
#ifdef BOOST_NO_CXX11_HDR_EXCEPTION
// this case can be handled losslesly with std::current_exception() (see below)
catch(
std::exception & e )
{
return exception_detail::current_exception_unknown_std_exception(e);
}
#endif
catch(
boost::exception & e )
{
return exception_detail::current_exception_unknown_boost_exception(e);
}

#endif // #ifdef BOOST_NO_CXX11_HDR_EXCEPTION

catch(
... )
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <boost/config.hpp>
#include <boost/exception/get_error_info.hpp>
#include <boost/exception/info.hpp>
#include <boost/utility/enable_if.hpp>
#include <boost/core/enable_if.hpp>
#ifndef BOOST_NO_RTTI
#include <boost/core/demangle.hpp>
#endif
Expand Down Expand Up @@ -149,11 +149,11 @@ boost
if( f )
{
tmp << *f;
if( int const * l=get_error_info<throw_line>(*be) )
if( l )
tmp << '(' << *l << "): ";
}
tmp << "Throw in function ";
if( char const * const * fn=get_error_info<throw_function>(*be) )
if( fn )
tmp << *fn;
else
tmp << "(unknown)";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#ifndef BOOST_EXCEPTION_7E48761AD92811DC9011477D56D89593
#define BOOST_EXCEPTION_7E48761AD92811DC9011477D56D89593

#include <boost/utility/enable_if.hpp>
#include <boost/core/enable_if.hpp>
#include <boost/exception/detail/is_output_streamable.hpp>
#include <sstream>

Expand Down

0 comments on commit 7c9f9f2

Please sign in to comment.