PR libstdc++/70483 make std::string_view fully constexpr
authorJonathan Wakely <jwakely@redhat.com>
Mon, 11 Sep 2017 21:47:41 +0000 (22:47 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Mon, 11 Sep 2017 21:47:41 +0000 (22:47 +0100)
commitc5ae1a27bd971cb0158d4a6d833f404804c2eb66
tree336ab7c5fab4fc0ad6c95dc94d2d0a6d50f400d7
parent738ae6eeee92a7317c889ebfa3df978cec997415
PR libstdc++/70483 make std::string_view fully constexpr

PR libstdc++/70483
* include/bits/string_view.tcc (basic_string_view::find)
(basic_string_view::rfind, basic_string_view::find_first_of)
(basic_string_view::find_last_of, basic_string_view::find_first_not_of)
(basic_string_view::find_last_not_of): Add constexpr specifier.
* include/std/string_view (basic_string_view::operator=)
(basic_string_view::rbegin, basic_string_view::rend)
(basic_string_view::crbegin, basic_string_view::crend)
(basic_string_view::remove_prefix, basic_string_view::remove_suffix)
(basic_string_view::swap, basic_string_view::compare)
(basic_string_view::find, basic_string_view::rfind)
(basic_string_view::find_first_of, basic_string_view::find_last_of)
(basic_string_view::find_first_not_of)
(basic_string_view::find_last_not_of, basic_string_view::_M_check)
(basic_string_view::_M_limit, operator==, operator!=, operator<)
(operator>, operator<=, operator>=): Likewise.
* testsuite/21_strings/basic_string_view/modifiers/remove_prefix/
char/1.cc: Repeat tests in constexpr context.
* testsuite/21_strings/basic_string_view/modifiers/remove_prefix/
wchar_t/1.cc: Likewise.
* testsuite/21_strings/basic_string_view/modifiers/remove_suffix/
char/1.cc: Likewise.
* testsuite/21_strings/basic_string_view/modifiers/remove_suffix/
wchar_t/1.cc: Likewise.
* testsuite/21_strings/basic_string_view/operations/find/char/1.cc:
Likewise.
* testsuite/21_strings/basic_string_view/operations/find/char/2.cc:
Likewise.
* testsuite/21_strings/basic_string_view/operations/find/char/3.cc:
Likewise.
* testsuite/21_strings/basic_string_view/operations/find/wchar_t/1.cc:
Likewise.
* testsuite/21_strings/basic_string_view/operations/find/wchar_t/2.cc:
Likewise.
* testsuite/21_strings/basic_string_view/operations/find/wchar_t/3.cc:
Likewise.
* testsuite/21_strings/basic_string_view/operators/char/2.cc:
Likewise.
* testsuite/21_strings/basic_string_view/operators/wchar_t/2.cc:
Likewise.
* testsuite/21_strings/basic_string_view/range_access/char/1.cc: Test
cbegin, cend, rbegin, rend, crbegin and crend.
* testsuite/21_strings/basic_string_view/range_access/wchar_t/1.cc:
Likewise.
* testsuite/21_strings/basic_string_view/operations/compare/char/1.cc:
Remove trailing whitespace.
* testsuite/21_strings/basic_string_view/operations/compare/wchar_t/
1.cc: Likewise.
* testsuite/21_strings/basic_string_view/modifiers/swap/char/1.cc:
New.
* testsuite/21_strings/basic_string_view/modifiers/swap/wchar_t/1.cc:
New.
* testsuite/21_strings/basic_string_view/operations/compare/char/2.cc:
New.
* testsuite/21_strings/basic_string_view/operations/compare/wchar_t/
2.cc: New.

From-SVN: r251988
24 files changed:
libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/string_view.tcc
libstdc++-v3/include/std/string_view
libstdc++-v3/testsuite/21_strings/basic_string_view/modifiers/remove_prefix/char/1.cc
libstdc++-v3/testsuite/21_strings/basic_string_view/modifiers/remove_prefix/wchar_t/1.cc
libstdc++-v3/testsuite/21_strings/basic_string_view/modifiers/remove_suffix/char/1.cc
libstdc++-v3/testsuite/21_strings/basic_string_view/modifiers/remove_suffix/wchar_t/1.cc
libstdc++-v3/testsuite/21_strings/basic_string_view/modifiers/swap/char/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/21_strings/basic_string_view/modifiers/swap/wchar_t/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/21_strings/basic_string_view/operations/compare/char/1.cc
libstdc++-v3/testsuite/21_strings/basic_string_view/operations/compare/char/2.cc [new file with mode: 0644]
libstdc++-v3/testsuite/21_strings/basic_string_view/operations/compare/char/70483.cc [new file with mode: 0644]
libstdc++-v3/testsuite/21_strings/basic_string_view/operations/compare/wchar_t/1.cc
libstdc++-v3/testsuite/21_strings/basic_string_view/operations/compare/wchar_t/2.cc [new file with mode: 0644]
libstdc++-v3/testsuite/21_strings/basic_string_view/operations/find/char/1.cc
libstdc++-v3/testsuite/21_strings/basic_string_view/operations/find/char/2.cc
libstdc++-v3/testsuite/21_strings/basic_string_view/operations/find/char/3.cc
libstdc++-v3/testsuite/21_strings/basic_string_view/operations/find/wchar_t/1.cc
libstdc++-v3/testsuite/21_strings/basic_string_view/operations/find/wchar_t/2.cc
libstdc++-v3/testsuite/21_strings/basic_string_view/operations/find/wchar_t/3.cc
libstdc++-v3/testsuite/21_strings/basic_string_view/operators/char/2.cc
libstdc++-v3/testsuite/21_strings/basic_string_view/operators/wchar_t/2.cc
libstdc++-v3/testsuite/21_strings/basic_string_view/range_access/char/1.cc
libstdc++-v3/testsuite/21_strings/basic_string_view/range_access/wchar_t/1.cc