This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/81338] stringstream remains empty after being moved into multiple times


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81338

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Author: redi
Date: Mon Jul 10 17:58:56 2017
New Revision: 250100

URL: https://gcc.gnu.org/viewcvs?rev=250100&root=gcc&view=rev
Log:
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.

Added:
    trunk/libstdc++-v3/testsuite/27_io/basic_stringstream/assign/81338.cc
Modified:
    trunk/libstdc++-v3/ChangeLog
    trunk/libstdc++-v3/include/bits/basic_string.h
    trunk/libstdc++-v3/include/bits/sstream.tcc
    trunk/libstdc++-v3/include/std/sstream

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]