libstdc++: Add remaining C++20 additions to <sstream> [P0408R7]
authorJonathan Wakely <jwakely@redhat.com>
Tue, 10 Nov 2020 15:57:04 +0000 (15:57 +0000)
committerJonathan Wakely <jwakely@redhat.com>
Tue, 10 Nov 2020 19:22:47 +0000 (19:22 +0000)
commit95cb0fc8c51841cc6a0e51490cb3769eb80fa34c
treed4d4b798f8e66ebdb86e4f8b4785c25f84cfcbe1
parentced70ebaa372945ec8d73703d81e4a10d6d51c9b
libstdc++: Add remaining C++20 additions to <sstream> [P0408R7]

This adds the new overloads of basic_stringbuf::str, and the
corresponding overloads to basic_istringstream, basic_ostringstream and
basic_stringstream.

libstdc++-v3/ChangeLog:

* config/abi/pre/gnu.ver (GLIBCXX_3.4.21): Tighten patterns.
(GLIBCXX_3.4.29): Export new symbols.
* include/bits/alloc_traits.h (__allocator_like): New concept.
* include/std/sstream (basic_stringbuf::swap): Add exception
specification.
(basic_stringbuf::str() const): Add ref-qualifier. Use new
_M_high_mark function.
(basic_stringbuf::str(const SAlloc&) const): Define new function.
(basic_stringbuf::str() &&): Likewise.
(basic_stringbuf::str(const basic_string<C,T,SAlloc>&)):
Likewise.
(basic_stringbuf::str(basic_string<C,T,Alloc>&&)): Likewise.
(basic_stringbuf::view() const): Use _M_high_mark.
(basic_istringstream::str, basic_ostringstream::str)
(basic_stringstream::str): Define new overloads.
* src/c++20/sstream-inst.cc (basic_stringbuf::str)
(basic_istringstream::str, basic_ostringstream::str)
(basic_stringstream::str): Explicit instantiation definitions
for new overloads.
* testsuite/27_io/basic_istringstream/view/char/1.cc: Add more
checks.
* testsuite/27_io/basic_istringstream/view/wchar_t/1.cc:
Likewise.
* testsuite/27_io/basic_ostringstream/view/char/1.cc:
Likewise.
* testsuite/27_io/basic_ostringstream/view/wchar_t/1.cc:
Likewise.
* testsuite/27_io/basic_stringstream/view/char/1.cc:
Likewise.
* testsuite/27_io/basic_stringstream/view/wchar_t/1.cc:
Likewise.
* testsuite/27_io/basic_istringstream/str/char/2.cc: New test.
* testsuite/27_io/basic_istringstream/str/wchar_t/2.cc: New test.
* testsuite/27_io/basic_ostringstream/str/char/3.cc: New test.
* testsuite/27_io/basic_ostringstream/str/wchar_t/3.cc: New test.
* testsuite/27_io/basic_stringbuf/str/char/4.cc: New test.
* testsuite/27_io/basic_stringbuf/str/wchar_t/4.cc: New test.
* testsuite/27_io/basic_stringstream/str/char/5.cc: New test.
* testsuite/27_io/basic_stringstream/str/wchar_t/5.cc.cc: New test.
18 files changed:
libstdc++-v3/config/abi/pre/gnu.ver
libstdc++-v3/include/bits/alloc_traits.h
libstdc++-v3/include/std/sstream
libstdc++-v3/src/c++20/sstream-inst.cc
libstdc++-v3/testsuite/27_io/basic_istringstream/str/char/2.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_istringstream/str/wchar_t/2.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_istringstream/view/char/1.cc
libstdc++-v3/testsuite/27_io/basic_istringstream/view/wchar_t/1.cc
libstdc++-v3/testsuite/27_io/basic_ostringstream/str/char/3.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_ostringstream/str/wchar_t/3.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_ostringstream/view/char/1.cc
libstdc++-v3/testsuite/27_io/basic_ostringstream/view/wchar_t/1.cc
libstdc++-v3/testsuite/27_io/basic_stringbuf/str/char/4.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_stringbuf/str/wchar_t/4.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_stringstream/str/char/5.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_stringstream/str/wchar_t/5.cc.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/basic_stringstream/view/char/1.cc
libstdc++-v3/testsuite/27_io/basic_stringstream/view/wchar_t/1.cc