diff options
author | Paolo Carlini <paolo@gcc.gnu.org> | 2009-06-03 10:37:20 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2009-06-03 10:37:20 +0000 |
commit | 110a123aae0196680d42ace6e3899304ceba4d1d (patch) | |
tree | c3568ccf621b03599044de8ca5b322f78fc7a78d /libstdc++-v3/libsupc++ | |
parent | 8cd281486b0025bd3a6f7f000e24be4a8d231e22 (diff) | |
download | gcc-110a123aae0196680d42ace6e3899304ceba4d1d.zip gcc-110a123aae0196680d42ace6e3899304ceba4d1d.tar.gz gcc-110a123aae0196680d42ace6e3899304ceba4d1d.tar.bz2 |
re PR libstdc++/40296 ([C++0x] std::exception_ptr comparisons)
2009-06-03 Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/40296
* libsupc++/exception_ptr.h (exception_ptr::operator!,
exception_ptr::operator __safe_bool): Only declare when
_GLIBCXX_EH_PTR_COMPAT is undefined.
* libsupc++/eh_ptr.cc: Define _GLIBCXX_EH_PTR_COMPAT before including
exception_ptr.
* testsuite/18_support/exception_ptr/40296.cc: New.
* testsuite/18_support/nested_exception/throw_with_nested.cc: Adjust.
* testsuite/18_support/nested_exception/cons.cc: Likewise.
* testsuite/18_support/nested_exception/nested_ptr.cc: Likewise.
* testsuite/18_support/exception_ptr/current_exception.cc: Likewise.
From-SVN: r148122
Diffstat (limited to 'libstdc++-v3/libsupc++')
-rw-r--r-- | libstdc++-v3/libsupc++/eh_ptr.cc | 6 | ||||
-rw-r--r-- | libstdc++-v3/libsupc++/exception_ptr.h | 12 |
2 files changed, 15 insertions, 3 deletions
diff --git a/libstdc++-v3/libsupc++/eh_ptr.cc b/libstdc++-v3/libsupc++/eh_ptr.cc index bbe5f8f..8d5a1b9 100644 --- a/libstdc++-v3/libsupc++/eh_ptr.cc +++ b/libstdc++-v3/libsupc++/eh_ptr.cc @@ -26,6 +26,8 @@ #ifdef _GLIBCXX_ATOMIC_BUILTINS_4 +#define _GLIBCXX_EH_PTR_COMPAT + #include <exception> #include <exception_ptr.h> #include "unwind-cxx.h" @@ -127,6 +129,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() { @@ -134,6 +137,7 @@ std::__exception_ptr::exception_ptr::operator!() const throw() } +// Retained for compatibility with CXXABI_1.3. std::__exception_ptr::exception_ptr::operator __safe_bool() const throw() { return _M_exception_object ? &exception_ptr::_M_safe_bool_dummy : 0; @@ -235,4 +239,6 @@ std::rethrow_exception(std::exception_ptr ep) std::terminate (); } +#undef _GLIBCXX_EH_PTR_COMPAT + #endif diff --git a/libstdc++-v3/libsupc++/exception_ptr.h b/libstdc++-v3/libsupc++/exception_ptr.h index 5699722..37f3132d 100644 --- a/libstdc++-v3/libsupc++/exception_ptr.h +++ b/libstdc++-v3/libsupc++/exception_ptr.h @@ -77,10 +77,12 @@ namespace std namespace __exception_ptr { bool - operator==(const exception_ptr&, const exception_ptr&) throw() __attribute__ ((__pure__)); + operator==(const exception_ptr&, const exception_ptr&) + throw() __attribute__ ((__pure__)); bool - operator!=(const exception_ptr&, const exception_ptr&) throw() __attribute__ ((__pure__)); + operator!=(const exception_ptr&, const exception_ptr&) + throw() __attribute__ ((__pure__)); class exception_ptr { @@ -141,11 +143,15 @@ namespace std } #endif +#ifdef _GLIBCXX_EH_PTR_COMPAT + // Retained for compatibility with CXXABI_1.3. bool operator!() const throw() __attribute__ ((__pure__)); operator __safe_bool() const throw(); +#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__)); |