This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[v3] libstdc++/40296 update exception_ptr w.r.t FCD


        PR libstdc++/40296
        * libsupc++/exception_ptr.h (exception_ptr::exception_ptr): Replace
        __safe_bool constructor with nullptr_t constructor in C++0x mode.
        (exception_ptr::operator bool): Add explicit conversion to bool.
        (swap(exception_ptr&, exception_ptr&)): Add.
        (exception_ptr::_M_safe_bool_dummy): Only declare for old ABI.
        * libsupc++/eh_ptr.cc (exception_ptr::_M_safe_bool_dummy): Move
        next to other functions retained for ABI compatibility.
        * testsuite/18_support/exception_ptr/requirements.cc: New.
        * testsuite/18_support/exception_ptr/requirements_neg.cc: New.

As stated in PR 40296, the FCD adds new requirements for exception_ptr.
This patch implements the contextual conversion to bool as well as
replacing the safebool constructor with a nullptr_t constructor, which
means std::exception_ptr(nullptr) is no longer ambiguous.
I also added a swap overload as an optimisation to avoid using the
default std::swap implementation.

Tested x86_64/Linux, committed to trunk.

Attachment: nullptr.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]