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++/86169] .data() fails to unshare strings


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

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Author: redi
Date: Fri Jun 15 18:47:29 2018
New Revision: 261642

URL: https://gcc.gnu.org/viewcvs?rev=261642&root=gcc&view=rev
Log:
PR libstdc++/86169 unshare COW string when non-const data() called

        PR libstdc++/86169
        * include/bits/basic_string.h [!_GLIBCXX_USE_CXX11_ABI]
        (basic_string::data()): Unshare string.
        * testsuite/21_strings/basic_string/operations/data/char/86169.cc:
        New.

Added:
   
trunk/libstdc++-v3/testsuite/21_strings/basic_string/operations/data/char/86169.cc
Modified:
    trunk/libstdc++-v3/ChangeLog
    trunk/libstdc++-v3/include/bits/basic_string.h

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