[gcc r11-4514] libstdc++: Fix new basic_stringbuf constructor

Jonathan Wakely redi@gcc.gnu.org
Thu Oct 29 01:28:25 GMT 2020


https://gcc.gnu.org/g:c6bfc4eb3c961181912647781d7dd38057db655b

commit r11-4514-gc6bfc4eb3c961181912647781d7dd38057db655b
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Thu Oct 29 01:05:03 2020 +0000

    libstdc++: Fix new basic_stringbuf constructor
    
    libstdc++-v3/ChangeLog:
    
            * include/std/sstream (basic_stringbuf(__string_type&&, openmode)):
            Call _M_init_syncbuf to set up get/put areas. Also qualify
            std::move.

Diff:
---
 libstdc++-v3/include/std/sstream | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libstdc++-v3/include/std/sstream b/libstdc++-v3/include/std/sstream
index f03f3abd6fc..33a00486606 100644
--- a/libstdc++-v3/include/std/sstream
+++ b/libstdc++-v3/include/std/sstream
@@ -181,8 +181,8 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
       basic_stringbuf(__string_type&& __s,
 	              ios_base::openmode __mode = ios_base::in
 						  | ios_base::out )
-      : __streambuf_type(), _M_mode(__mode), _M_string(move(__s))
-      { }
+      : __streambuf_type(), _M_mode(__mode), _M_string(std::move(__s))
+      { _M_stringbuf_init(__mode); }
 
       template<typename _SAlloc>
       basic_stringbuf(const basic_string<_CharT, _Traits, _SAlloc>& __s,


More information about the Libstdc++-cvs mailing list