gcc/libstdc++-v3/include/std
Jonathan Wakely 432258be4f libstdc++: Fix new <sstream> constructors
- Add a missing 'explicit' to a basic_stringbuf constructor.
- Set up the get/put area pointers in the constructor from strings using
  different allocator types.
- Remove public basic_stringbuf::__sv_type alias.
- Do not construct temporary basic_string objects with a
  default-constructed allocator.

Also, change which basic_string constructor is used, as a minor
compile-time optimization. Constructing from a basic_string_view
requires more work from the compiler, so just use a pointer and length.

libstdc++-v3/ChangeLog:

	* include/std/sstream (basic_stringbuf(const allocator_type&):
	Add explicit.
	(basic_stringbuf(const basic_string<C,T,SA>&, openmode, const A&)):
	Call _M_stringbuf_init. Construct _M_string from pointer and length
	to avoid constraint checks for string view.
	(basic_stringbuf::view()): Make __sv_type alias local to the
	function.
	(basic_istringstream(const basic_string<C,T,SA>&, openmode, const A&)):
	Pass string to _M_streambuf instead of constructing a temporary
	with the wrong allocator.
	(basic_ostringstream(const basic_string<C,T,SA>&, openmode, const A&)):
	Likewise.
	(basic_stringstream(const basic_string<C,T,SA>&, openmode, const A&)):
	Likewise.
	* src/c++20/sstream-inst.cc: Use string_view and wstring_view
	typedefs in explicit instantiations.
	* testsuite/27_io/basic_istringstream/cons/char/1.cc: Add more
	tests for constructors.
	* testsuite/27_io/basic_ostringstream/cons/char/1.cc: Likewise.
	* testsuite/27_io/basic_stringbuf/cons/char/1.cc: Likewise.
	* testsuite/27_io/basic_stringbuf/cons/char/2.cc: Likewise.
	* testsuite/27_io/basic_stringbuf/cons/wchar_t/1.cc: Likewise.
	* testsuite/27_io/basic_stringbuf/cons/wchar_t/2.cc: Likewise.
	* testsuite/27_io/basic_stringstream/cons/char/1.cc: Likewise.
2020-11-05 13:31:32 +00:00
..
algorithm
any
array libstdc++: Fix three-way comparison for std::array [PR 96851] 2020-09-02 15:32:11 +01:00
atomic libstdc++: Break long lines to fit in 80 columns 2020-08-05 22:48:17 +01:00
bit libstdc++: Replace __int_limits with __numeric_traits_integer 2020-07-07 23:36:29 +01:00
bitset
charconv libstdc++: Add missing noexcept to std::from_chars declarations 2020-10-27 14:50:38 +00:00
chrono libstdc++: Fix arithmetic bug in year_month_weekday conversion [PR96713] 2020-10-28 12:28:08 -04:00
codecvt
complex libstdc++: Fix -Wmismatched-tags warnings (PR 96063) 2020-07-06 17:12:29 +01:00
concepts libstdc++: Fix typos in copyright notice 2020-10-15 19:20:21 +01:00
condition_variable libstdc++: Reduce header dependencies in and on <memory> 2020-10-22 18:42:03 +01:00
coroutine libstdc++: Define noop coroutine details private and inline [PR 95917] 2020-10-20 11:37:48 +01:00
deque
execution
filesystem
forward_list
fstream libstdc++: Override BUFSIZ for Windows targets [PR 94268] 2020-10-28 13:19:21 +00:00
functional libstdc++: Fix ODR violations caused by <tr1/functional> 2020-10-27 16:32:53 +00:00
future libstdc++: Reduce header dependencies in and on <memory> 2020-10-22 18:42:03 +01:00
iomanip
ios
iosfwd
iostream
istream libstdc++: Adjust overflow prevention to operator>> 2020-08-06 18:26:45 +01:00
iterator
limits libstdc++: Make __int128 meet integer-class requirements [PR 96042] 2020-08-19 16:49:07 +01:00
list
locale
map
memory libstdc++: Reduce header dependencies in and on <memory> 2020-10-22 18:42:03 +01:00
memory_resource libstdc++: Ensure std::forward_as_tuple is defined 2020-10-23 01:12:00 +01:00
mutex libstdc++: Rewrite std::call_once to use futexes [PR 66146] 2020-11-03 18:44:49 +00:00
numbers
numeric libstdc++: Minor header cleanup in <numeric> 2020-10-05 22:46:46 +01:00
optional libstdc++: Cleanup whitespace and type trait usage in <optional> 2020-07-06 21:55:50 +01:00
ostream
queue
random
ranges libstdc++: Don't initialize from *this inside some views [PR97600] 2020-10-30 20:33:19 -04:00
ratio
regex libstdc++: Reduce uses of std::numeric_limits 2020-10-06 00:05:11 +01:00
scoped_allocator libstdc++: Reduce header dependencies in and on <memory> 2020-10-22 18:42:03 +01:00
set
shared_mutex libstdc++: Only include <condition_variable> in <shared_mutex> if needed 2020-10-22 18:49:38 +01:00
span libstdc++: Make std::span layout-compatible with struct iovec [PR 95609] 2020-10-28 12:07:40 +00:00
sstream libstdc++: Fix new <sstream> constructors 2020-11-05 13:31:32 +00:00
stack
stdexcept
stop_token libstdc++: Fix <stop_token> to compile without gthreads 2020-08-11 16:16:21 +01:00
streambuf libstdc++: Add deprecated attributes to old iostream members 2020-08-19 12:13:23 +01:00
string
string_view libstdc++: Reduce uses of std::numeric_limits 2020-10-06 00:05:11 +01:00
syncstream libstdc++: Ensure std::lock_guard is declared 2020-11-03 21:56:44 +00:00
system_error libstdc++: Fix -Wmismatched-tags warnings (PR 96063) 2020-07-06 17:12:29 +01:00
thread libstdc++: Remove redundant copying of std::async arguments [PR 69724] 2020-08-18 14:28:38 +01:00
tuple libstdc++: Use reserved name for C++20 attribute 2020-10-19 18:07:21 +01:00
type_traits libstdc++: Define type traits for wchar_t even when libc support missing 2020-11-01 11:39:07 +00:00
typeindex
unordered_map
unordered_set
utility libstdc++: Replace __int_limits with __numeric_traits_integer 2020-07-07 23:36:29 +01:00
valarray libstdc++: Fix -Wmismatched-tags warnings (PR 96063) 2020-07-06 17:12:29 +01:00
variant libstdc++: Fix some warnings in headers 2020-10-29 22:47:22 +00:00
vector
version libstdc++: Add c++2a <syncstream> 2020-11-02 10:41:32 -08:00