diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2020-04-17 16:24:49 +0100 |
---|---|---|
committer | Jonathan Wakely <jwakely@redhat.com> | 2020-04-17 16:40:11 +0100 |
commit | 875d6cb3b4919b58ae5e6313db715bc4dd3ddd6c (patch) | |
tree | 60ec809bcce439236e5778bc5b6a8c9d4d1fbcf0 /libgomp | |
parent | 8b50d7a47624030d87645237c60bd8f7ac78b2ec (diff) | |
download | gcc-875d6cb3b4919b58ae5e6313db715bc4dd3ddd6c.zip gcc-875d6cb3b4919b58ae5e6313db715bc4dd3ddd6c.tar.gz gcc-875d6cb3b4919b58ae5e6313db715bc4dd3ddd6c.tar.bz2 |
libstdc++: Add comparison operators for string and regex types
Some more C++20 changes from P1614R2, "The Mothership has Landed".
This adds three-way comparison support to std::char_traits,
std::basic_string, std::basic_string_view, and std::sub_match.
* include/bits/basic_string.h (basic_string): Define operator<=> and
remove redundant comparison operators for C++20.
* include/bits/char_traits.h (__gnu_cxx::char_traits, char_traits):
Add comparison_category members.
(__detail::__char_traits_cmp_cat): New helper to get comparison
category from char traits class.
* include/bits/regex.h (regex_traits::_RegexMask::operator!=): Do not
define for C++20.
(sub_match): Define operator<=> and remove redundant comparison
operators for C++20.
(match_results): Remove redundant operator!= for C++20.
* include/std/string_view (basic_string_view): Define operator<=> and
remove redundant comparison operators for C++20.
* testsuite/21_strings/basic_string/operators/char/cmp_c++20.cc: New
test.
* testsuite/21_strings/basic_string/operators/wchar_t/cmp_c++20.cc:
New test.
* testsuite/21_strings/basic_string_view/operations/copy/char/
constexpr.cc: Initialize variable.
* testsuite/21_strings/basic_string_view/operations/copy/wchar_t/
constexpr.cc: Likewise.
* testsuite/21_strings/basic_string_view/operators/char/2.cc: Add
dg-do directive and remove comments showing incorrect signatures.
* testsuite/21_strings/basic_string_view/operators/wchar_t/2.cc:
Likewise.
* testsuite/21_strings/basic_string_view/operators/char/cmp_c++20.cc:
New test.
* testsuite/21_strings/basic_string_view/operators/wchar_t/cmp_c++20.cc:
New test.
* testsuite/28_regex/sub_match/compare_c++20.cc: New test.
Diffstat (limited to 'libgomp')
0 files changed, 0 insertions, 0 deletions