libstdc++: Implement spaceship for std::array (P1614R2)
commit7da0fc24aa6bb985ceafbfd8fab729ca00bf6703
authorredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 5 Dec 2019 00:42:06 +0000 (5 00:42 +0000)
committerredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 5 Dec 2019 00:42:06 +0000 (5 00:42 +0000)
tree204b53d72bcd8d72a429ccc276d959002b69f048
parent265750588266c6207ce08bab81d8f5c88c9f46c7
libstdc++: Implement spaceship for std::array (P1614R2)

As done for std::pair, this defines operator<=> as a non-member function
template and does not alter operator==, as expected to be proposed as
the resolution to an unpublished LWG issue.

Instead of calling std::lexicographical_compare_three_way the <=>
overload is implemented by hand to take advantage of the fact the
element types and array sizes are known to be the same.

* include/bits/cpp_type_traits.h (__is_byte<char8_t>): Add
specialization.
* include/std/array (operator<=>): Likewise.
* testsuite/23_containers/array/comparison_operators/constexpr.cc:
Test three-way comparisons and arrays of unsigned char.
* testsuite/23_containers/array/tuple_interface/get_neg.cc: Adjust
dg-error line numbers.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@278981 138bc75d-0d04-0410-961f-82ee72b054a4
libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/cpp_type_traits.h
libstdc++-v3/include/std/array
libstdc++-v3/testsuite/23_containers/array/comparison_operators/constexpr.cc
libstdc++-v3/testsuite/23_containers/array/tuple_interface/get_neg.cc