gcc/libstdc++-v3/include
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
..
backward libstdc++: Add deprecated attributes to old iostream members 2020-08-19 12:13:23 +01:00
bits libstdc++: Define new C++17 std::search overload for Parallel Mode [PR 94971] 2020-11-04 13:36:32 +00:00
c Update copyright years. 2020-01-01 12:51:42 +01:00
c_compatibility Update copyright years. 2020-01-01 12:51:42 +01:00
c_global libstdc++: Add parentheses around assignments used as truth values 2020-09-10 17:09:16 +01:00
c_std Update copyright years. 2020-01-01 12:51:42 +01:00
debug libstdc++: Fix some warnings in headers 2020-10-29 11:43:55 +00:00
decimal Update copyright years. 2020-01-01 12:51:42 +01:00
experimental libstdc++: Fix some warnings in headers 2020-10-29 22:47:22 +00:00
ext libstdc++: Do not use volatile for __gnu_cxx::rope reference counting 2020-10-29 14:47:17 +00:00
parallel libstdc++: Define new C++17 std::search overload for Parallel Mode [PR 94971] 2020-11-04 13:36:32 +00:00
precompiled libstdc++: Add c++2a <syncstream> 2020-11-02 10:41:32 -08:00
pstl libstdc++: Rebase include/pstl to current upstream 2020-10-21 06:11:28 -07:00
std libstdc++: Fix new <sstream> constructors 2020-11-05 13:31:32 +00:00
tr1 libstdc++: Prevent deprecation warnings from <tr1/shared_ptr> 2020-10-29 22:47:22 +00:00
tr2 Update copyright years. 2020-01-01 12:51:42 +01:00
Makefile.am libstdc++: Add c++2a <syncstream> 2020-11-02 10:41:32 -08:00
Makefile.in libstdc++: Add c++2a <syncstream> 2020-11-02 10:41:32 -08:00