]> git.ipfire.org Git - thirdparty/gcc.git/commit
libstdc++: Define std::basic_stringbuf::view() for old std::string ABI
authorJonathan Wakely <jwakely@redhat.com>
Tue, 31 Jan 2023 22:32:15 +0000 (22:32 +0000)
committerJonathan Wakely <jwakely@redhat.com>
Thu, 2 Feb 2023 16:57:27 +0000 (16:57 +0000)
commit331b4f168a06cd85fe40fd03b48b128cc8af399c
tree39eb6d6ff508e4d9acc74c3aa7f8d941fc13713c
parentdb8d6fc572ec316ccfcf70b1dffe3be0b1b37212
libstdc++: Define std::basic_stringbuf::view() for old std::string ABI

Unlike the new str()&& members in <sstream>, there is no real difficulty
in supporting the new view() members for the old std::string ABI.
Enabling it fixes errors in <chrono> where std::ostringstream::view() is
used by ostream insertion operators for calendar types.

We just need to use [[gnu::always_inline]] on the view() members for the
old ABI, because the library doesn't contain instantiations of them for
the old ABI. Making them always inline avoids needing to add those
instantiations and export them.

libstdc++-v3/ChangeLog:

* include/std/sstream  (basic_stringbuf::view): Define for old
std::string ABI.
(basic_istringstream::view, basic_0stringstream::view)
(basic_stringstream::view): Likewise.
* testsuite/27_io/basic_istringstream/view/char/1.cc: Remove
{ dg-require-effective-target cxx11_abi }.
* 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_stringbuf/view/char/1.cc: Likewise.
* testsuite/27_io/basic_stringbuf/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.
libstdc++-v3/include/std/sstream
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/view/char/1.cc
libstdc++-v3/testsuite/27_io/basic_ostringstream/view/wchar_t/1.cc
libstdc++-v3/testsuite/27_io/basic_stringbuf/view/char/1.cc
libstdc++-v3/testsuite/27_io/basic_stringbuf/view/wchar_t/1.cc
libstdc++-v3/testsuite/27_io/basic_stringstream/view/char/1.cc
libstdc++-v3/testsuite/27_io/basic_stringstream/view/wchar_t/1.cc