libstdc++: Fix constraints on std::compare_three_way
authorJonathan Wakely <jwakely@redhat.com>
Tue, 14 Apr 2020 20:58:03 +0000 (21:58 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Tue, 14 Apr 2020 20:59:15 +0000 (21:59 +0100)
commite1e9e8d7aa7bf1b0d3de34345b6c649e07da7a1e
tree104248697a76241f95b6fe9103bfeaafb896e2e5
parentf5fa62ed19a1c85cda920bbe05eb075d8f2a0b42
libstdc++: Fix constraints on std::compare_three_way

My "simplification" of std::compare_three_way's constraints in commit
f214ffb336d582a66149068a2a96b7fcf395b5de was incorrect, because
std::three_way_comparable_with imposes additional restrictions beyond
the <=> expression being valid.

* libsupc++/compare (compare_three_way): Fix constraint so that
BUILTIN-PTR-THREE-WAY does not require three_way_comparable_with.
* testsuite/18_support/comparisons/object/builtin-ptr-three-way.cc:
New test.
libstdc++-v3/ChangeLog
libstdc++-v3/libsupc++/compare
libstdc++-v3/testsuite/18_support/comparisons/object/builtin-ptr-three-way.cc [new file with mode: 0644]