https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91073

--- Comment #9 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Author: redi
Date: Tue Dec  3 23:57:46 2019
New Revision: 278951

URL: https://gcc.gnu.org/viewcvs?rev=278951&root=gcc&view=rev
Log:
libstdc++: Implement spaceship for std::pair (P1614R2)

This defines operator<=> as a non-member function template and does not
alter operator==. This contradicts the changes made by P1614R2, which
specify both as hidden friends, but that specification of operator<=> is
broken and the subject of a soon-to-be-published LWG issue.

        * include/bits/stl_pair.h [__cpp_lib_three_way_comparison]
        (operator<=>): Define for C++20.
        * libsupc++/compare (__cmp2way_res_t): Rename to __cmp3way_res_t,
        move into __detail namespace. Do not turn argument types into lvalues.
        (__cmp3way_helper): Rename to __cmp3way_res_impl, move into __detail
        namespace. Constrain with concepts instead of using void_t.
        (compare_three_way_result): Adjust name of base class.
        (compare_three_way_result_t): Use __cmp3way_res_impl directly.
        (__detail::__3way_cmp_with): Add workaround for PR 91073.
        (compare_three_way): Use workaround.
        (__detail::__synth3way, __detail::__synth3way_t): Define new helpers
        implementing synth-three-way and synth-three-way-result semantics.
        * testsuite/20_util/pair/comparison_operators/constexpr_c++20.cc: New
        test.

Added:
   
trunk/libstdc++-v3/testsuite/20_util/pair/comparison_operators/constexpr_c++20.cc
Modified:
    trunk/libstdc++-v3/ChangeLog
    trunk/libstdc++-v3/include/bits/stl_pair.h
    trunk/libstdc++-v3/libsupc++/compare

Reply via email to