PR libstdc++/81338 correctly manage string capacity
authorJonathan Wakely <jwakely@redhat.com>
Mon, 10 Jul 2017 17:58:56 +0000 (18:58 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Mon, 10 Jul 2017 17:58:56 +0000 (18:58 +0100)
commit93ef155b3d2b4de31dec16596f71f3c1eb9b8a03
tree24778fc62f28419369156b33052d4e8bc55f1add
parentb1938888f5a072e5619acba11b9e6ded42956ca3
PR libstdc++/81338 correctly manage string capacity

PR libstdc++/81338
* include/bits/basic_string.h [_GLIBCXX_USE_CXX11_ABI] (basic_string):
Declare basic_stringbuf to be a friend.
* include/bits/sstream.tcc (basic_stringbuf::overflow)
[_GLIBCXX_USE_CXX11_ABI]: Use unused capacity before reallocating.
* include/std/sstream (basic_stringbuf::__xfer_bufptrs): Update string
length to buffer length.
* testsuite/27_io/basic_stringstream/assign/81338.cc: New.

From-SVN: r250100
libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/basic_string.h
libstdc++-v3/include/bits/sstream.tcc
libstdc++-v3/include/std/sstream
libstdc++-v3/testsuite/27_io/basic_stringstream/assign/81338.cc [new file with mode: 0644]