user.cfg.in: Regenerate, add files.
2009-11-09 Benjamin Kosnik <bkoz@redhat.com> * doc/doxygen/user.cfg.in: Regenerate, add files. * libsupc++/eh_ptr.cc: Format. * libsupc++/exception_ptr.h: Same. * libsupc++/cxxabi.h(recursive_init_error): Move declaration here. * libsupc++/guard.cc: From here. * libsupc++/nested_exception.h: Add markup. From-SVN: r154054
This commit is contained in:
parent
3f08607cac
commit
8eead16e5e
7 changed files with 785 additions and 812 deletions
|
@ -1,3 +1,12 @@
|
|||
2009-11-09 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
* doc/doxygen/user.cfg.in: Regenerate, add files.
|
||||
* libsupc++/eh_ptr.cc: Format.
|
||||
* libsupc++/exception_ptr.h: Same.
|
||||
* libsupc++/cxxabi.h(recursive_init_error): Move declaration here.
|
||||
* libsupc++/guard.cc: From here.
|
||||
* libsupc++/nested_exception.h: Add markup.
|
||||
|
||||
2009-11-09 Johannes Singler <singler@kit.edu>
|
||||
|
||||
* include/parallel/multiway_merge.h (multiway_merge_*,
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -100,7 +100,7 @@ namespace __cxxabiv1
|
|||
|
||||
void
|
||||
__cxa_vec_cleanup(void* __array_address, size_t __element_count,
|
||||
size_t __element_size, __cxa_cdtor_type destructor) _GLIBCXX_NOTHROW;
|
||||
size_t __s, __cxa_cdtor_type destructor) _GLIBCXX_NOTHROW;
|
||||
|
||||
// Destruct and release array.
|
||||
void
|
||||
|
@ -601,6 +601,27 @@ namespace __cxxabiv1
|
|||
*/
|
||||
namespace abi = __cxxabiv1;
|
||||
|
||||
namespace __gnu_cxx
|
||||
{
|
||||
/**
|
||||
* @brief Exception thrown by __cxa_guard_acquire.
|
||||
* @ingroup exceptions
|
||||
*
|
||||
* 6.7[stmt.dcl]/4: If control re-enters the declaration (recursively)
|
||||
* while the object is being initialized, the behavior is undefined.
|
||||
*
|
||||
* Since we already have a library function to handle locking, we might
|
||||
* as well check for this situation and throw an exception.
|
||||
* We use the second byte of the guard variable to remember that we're
|
||||
* in the middle of an initialization.
|
||||
*/
|
||||
class recursive_init_error: public std::exception
|
||||
{
|
||||
public:
|
||||
recursive_init_error() throw() { }
|
||||
virtual ~recursive_init_error() throw ();
|
||||
};
|
||||
}
|
||||
#endif // __cplusplus
|
||||
|
||||
#pragma GCC visibility pop
|
||||
|
|
|
@ -35,41 +35,30 @@
|
|||
using namespace __cxxabiv1;
|
||||
|
||||
std::__exception_ptr::exception_ptr::exception_ptr() throw()
|
||||
: _M_exception_object(0)
|
||||
{
|
||||
}
|
||||
: _M_exception_object(0) { }
|
||||
|
||||
|
||||
std::__exception_ptr::exception_ptr::exception_ptr(void* obj) throw()
|
||||
: _M_exception_object(obj)
|
||||
{
|
||||
_M_addref();
|
||||
}
|
||||
: _M_exception_object(obj) { _M_addref(); }
|
||||
|
||||
|
||||
std::__exception_ptr::exception_ptr::exception_ptr(__safe_bool) throw()
|
||||
: _M_exception_object(0)
|
||||
{
|
||||
}
|
||||
: _M_exception_object(0) { }
|
||||
|
||||
|
||||
std::__exception_ptr::exception_ptr::exception_ptr(
|
||||
const exception_ptr& other) throw()
|
||||
: _M_exception_object(other._M_exception_object)
|
||||
{
|
||||
_M_addref();
|
||||
}
|
||||
std::__exception_ptr::
|
||||
exception_ptr::exception_ptr(const exception_ptr& other) throw()
|
||||
: _M_exception_object(other._M_exception_object)
|
||||
{ _M_addref(); }
|
||||
|
||||
|
||||
std::__exception_ptr::exception_ptr::~exception_ptr() throw()
|
||||
{
|
||||
_M_release();
|
||||
}
|
||||
{ _M_release(); }
|
||||
|
||||
|
||||
std::__exception_ptr::exception_ptr&
|
||||
std::__exception_ptr::exception_ptr::operator=(
|
||||
const exception_ptr& other) throw()
|
||||
std::__exception_ptr::
|
||||
exception_ptr::operator=(const exception_ptr& other) throw()
|
||||
{
|
||||
exception_ptr(other).swap(*this);
|
||||
return *this;
|
||||
|
@ -109,15 +98,11 @@ std::__exception_ptr::exception_ptr::_M_release() throw()
|
|||
|
||||
void*
|
||||
std::__exception_ptr::exception_ptr::_M_get() const throw()
|
||||
{
|
||||
return _M_exception_object;
|
||||
}
|
||||
{ return _M_exception_object; }
|
||||
|
||||
|
||||
void
|
||||
std::__exception_ptr::exception_ptr::_M_safe_bool_dummy() throw ()
|
||||
{
|
||||
}
|
||||
std::__exception_ptr::exception_ptr::_M_safe_bool_dummy() throw () { }
|
||||
|
||||
|
||||
void
|
||||
|
@ -132,9 +117,7 @@ std::__exception_ptr::exception_ptr::swap(exception_ptr &other) throw()
|
|||
// Retained for compatibility with CXXABI_1.3.
|
||||
bool
|
||||
std::__exception_ptr::exception_ptr::operator!() const throw()
|
||||
{
|
||||
return _M_exception_object == 0;
|
||||
}
|
||||
{ return _M_exception_object == 0; }
|
||||
|
||||
|
||||
// Retained for compatibility with CXXABI_1.3.
|
||||
|
@ -153,17 +136,13 @@ std::__exception_ptr::exception_ptr::__cxa_exception_type() const throw()
|
|||
|
||||
|
||||
bool std::__exception_ptr::operator==(const exception_ptr& lhs,
|
||||
const exception_ptr& rhs) throw()
|
||||
{
|
||||
return lhs._M_exception_object == rhs._M_exception_object;
|
||||
}
|
||||
const exception_ptr& rhs) throw()
|
||||
{ return lhs._M_exception_object == rhs._M_exception_object; }
|
||||
|
||||
|
||||
bool std::__exception_ptr::operator!=(const exception_ptr& lhs,
|
||||
const exception_ptr& rhs) throw()
|
||||
{
|
||||
return !(lhs == rhs);
|
||||
}
|
||||
const exception_ptr& rhs) throw()
|
||||
{ return !(lhs == rhs);}
|
||||
|
||||
|
||||
std::exception_ptr
|
||||
|
@ -185,8 +164,8 @@ std::current_exception() throw()
|
|||
|
||||
|
||||
static void
|
||||
__gxx_dependent_exception_cleanup (_Unwind_Reason_Code code,
|
||||
_Unwind_Exception *exc)
|
||||
__gxx_dependent_exception_cleanup(_Unwind_Reason_Code code,
|
||||
_Unwind_Exception *exc)
|
||||
{
|
||||
// This cleanup is set only for dependents.
|
||||
__cxa_dependent_exception *dep = __get_dependent_exception_from_ue (exc);
|
||||
|
@ -236,7 +215,7 @@ std::rethrow_exception(std::exception_ptr ep)
|
|||
|
||||
// Some sort of unwinding error. Note that terminate is a handler.
|
||||
__cxa_begin_catch (&dep->unwindHeader);
|
||||
std::terminate ();
|
||||
std::terminate();
|
||||
}
|
||||
|
||||
#undef _GLIBCXX_EH_PTR_COMPAT
|
||||
|
|
|
@ -48,42 +48,28 @@ namespace std
|
|||
* @addtogroup exceptions
|
||||
* @{
|
||||
*/
|
||||
|
||||
// Hide the free operators from other types
|
||||
namespace __exception_ptr
|
||||
{
|
||||
/**
|
||||
* @brief An opaque pointer to an arbitrary exception.
|
||||
*/
|
||||
class exception_ptr;
|
||||
}
|
||||
|
||||
using __exception_ptr::exception_ptr;
|
||||
|
||||
/** Obtain an %exception_ptr to the currently handled exception. If there
|
||||
/** Obtain an exception_ptr to the currently handled exception. If there
|
||||
* is none, or the currently handled exception is foreign, return the null
|
||||
* value.
|
||||
*/
|
||||
exception_ptr current_exception() throw();
|
||||
|
||||
/// Throw the object pointed to by the %exception_ptr.
|
||||
/// Throw the object pointed to by the exception_ptr.
|
||||
void rethrow_exception(exception_ptr) __attribute__ ((__noreturn__));
|
||||
|
||||
/// Obtain an %exception_ptr pointing to a copy of the supplied object.
|
||||
template<typename _Ex>
|
||||
exception_ptr
|
||||
copy_exception(_Ex __ex) throw();
|
||||
|
||||
namespace __exception_ptr
|
||||
{
|
||||
bool
|
||||
operator==(const exception_ptr&, const exception_ptr&)
|
||||
throw() __attribute__ ((__pure__));
|
||||
|
||||
bool
|
||||
operator!=(const exception_ptr&, const exception_ptr&)
|
||||
throw() __attribute__ ((__pure__));
|
||||
|
||||
/**
|
||||
* @brief An opaque pointer to an arbitrary exception.
|
||||
* @ingroup exceptions
|
||||
*/
|
||||
class exception_ptr
|
||||
{
|
||||
void* _M_exception_object;
|
||||
|
@ -140,16 +126,24 @@ namespace std
|
|||
#endif
|
||||
|
||||
friend bool
|
||||
operator==(const exception_ptr&, const exception_ptr&)
|
||||
throw() __attribute__ ((__pure__));
|
||||
operator==(const exception_ptr&, const exception_ptr&) throw()
|
||||
__attribute__ ((__pure__));
|
||||
|
||||
const type_info*
|
||||
__cxa_exception_type() const throw() __attribute__ ((__pure__));
|
||||
};
|
||||
|
||||
bool
|
||||
operator==(const exception_ptr&, const exception_ptr&) throw()
|
||||
__attribute__ ((__pure__));
|
||||
|
||||
bool
|
||||
operator!=(const exception_ptr&, const exception_ptr&) throw()
|
||||
__attribute__ ((__pure__));
|
||||
} // namespace __exception_ptr
|
||||
|
||||
|
||||
/// Obtain an exception_ptr pointing to a copy of the supplied object.
|
||||
template<typename _Ex>
|
||||
exception_ptr
|
||||
copy_exception(_Ex __ex) throw()
|
||||
|
|
|
@ -136,20 +136,6 @@ __set_and_release (__cxxabiv1::__guard *g)
|
|||
|
||||
namespace __gnu_cxx
|
||||
{
|
||||
// 6.7[stmt.dcl]/4: If control re-enters the declaration (recursively)
|
||||
// while the object is being initialized, the behavior is undefined.
|
||||
|
||||
// Since we already have a library function to handle locking, we might
|
||||
// as well check for this situation and throw an exception.
|
||||
// We use the second byte of the guard variable to remember that we're
|
||||
// in the middle of an initialization.
|
||||
class recursive_init_error: public std::exception
|
||||
{
|
||||
public:
|
||||
recursive_init_error() throw() { }
|
||||
virtual ~recursive_init_error() throw ();
|
||||
};
|
||||
|
||||
recursive_init_error::~recursive_init_error() throw() { }
|
||||
}
|
||||
|
||||
|
|
|
@ -51,9 +51,11 @@ namespace std
|
|||
* @{
|
||||
*/
|
||||
|
||||
/// nested_exception
|
||||
/// Exception class with exception_ptr data member.
|
||||
class nested_exception
|
||||
{
|
||||
exception_ptr _M_ptr;
|
||||
|
||||
public:
|
||||
nested_exception() throw() : _M_ptr(current_exception()) { }
|
||||
|
||||
|
@ -70,16 +72,12 @@ namespace std
|
|||
exception_ptr
|
||||
nested_ptr() const
|
||||
{ return _M_ptr; }
|
||||
|
||||
private:
|
||||
exception_ptr _M_ptr;
|
||||
};
|
||||
|
||||
template<typename _Except>
|
||||
struct _Nested_exception : public _Except, public nested_exception
|
||||
{
|
||||
explicit
|
||||
_Nested_exception(_Except&& __ex)
|
||||
explicit _Nested_exception(_Except&& __ex)
|
||||
: _Except(static_cast<_Except&&>(__ex))
|
||||
{ }
|
||||
};
|
||||
|
@ -89,9 +87,7 @@ namespace std
|
|||
{
|
||||
static const nested_exception*
|
||||
_S_get(const _Ex& __ex)
|
||||
{
|
||||
return dynamic_cast<const nested_exception*>(&__ex);
|
||||
}
|
||||
{ return dynamic_cast<const nested_exception*>(&__ex); }
|
||||
};
|
||||
|
||||
template<typename _Ex>
|
||||
|
@ -99,17 +95,13 @@ namespace std
|
|||
{
|
||||
static const nested_exception*
|
||||
_S_get(const _Ex* __ex)
|
||||
{
|
||||
return dynamic_cast<const nested_exception*>(__ex);
|
||||
}
|
||||
{ return dynamic_cast<const nested_exception*>(__ex); }
|
||||
};
|
||||
|
||||
template<typename _Ex>
|
||||
inline const nested_exception*
|
||||
__get_nested_exception(const _Ex& __ex)
|
||||
{
|
||||
return __get_nested_helper<_Ex>::_S_get(__ex);
|
||||
}
|
||||
{ return __get_nested_helper<_Ex>::_S_get(__ex); }
|
||||
|
||||
template<typename _Ex>
|
||||
void
|
||||
|
@ -126,21 +118,19 @@ namespace std
|
|||
template<typename _Ex>
|
||||
inline void
|
||||
__throw_with_nested(_Ex&& __ex, const nested_exception* = 0)
|
||||
{
|
||||
throw __ex;
|
||||
}
|
||||
{ throw __ex; }
|
||||
|
||||
template<typename _Ex>
|
||||
inline void
|
||||
__throw_with_nested(_Ex&& __ex, ...)
|
||||
{
|
||||
throw _Nested_exception<_Ex>(static_cast<_Ex&&>(__ex));
|
||||
}
|
||||
{ throw _Nested_exception<_Ex>(static_cast<_Ex&&>(__ex)); }
|
||||
|
||||
template<typename _Ex>
|
||||
void
|
||||
throw_with_nested(_Ex __ex) __attribute__ ((__noreturn__));
|
||||
|
||||
/// If @p __ex is derived from nested_exception, @p __ex.
|
||||
/// Else, an implementation-defined object derived from both.
|
||||
template<typename _Ex>
|
||||
inline void
|
||||
throw_with_nested(_Ex __ex)
|
||||
|
@ -150,6 +140,7 @@ namespace std
|
|||
__throw_with_nested(static_cast<_Ex&&>(__ex), &__ex);
|
||||
}
|
||||
|
||||
/// If @p __ex is derived from nested_exception, @p __ex.rethrow_nested().
|
||||
template<typename _Ex>
|
||||
inline void
|
||||
rethrow_if_nested(const _Ex& __ex)
|
||||
|
@ -158,12 +149,10 @@ namespace std
|
|||
__nested->rethrow_nested();
|
||||
}
|
||||
|
||||
// see n2619
|
||||
/// Overload, See N2619
|
||||
inline void
|
||||
rethrow_if_nested(const nested_exception& __ex)
|
||||
{
|
||||
__ex.rethrow_nested();
|
||||
}
|
||||
{ __ex.rethrow_nested(); }
|
||||
|
||||
// @} group exceptions
|
||||
} // namespace std
|
||||
|
|
Loading…
Add table
Reference in a new issue