LWG2788 basic_string spurious use of a default constructible allocator

Programming / Compilers / GCC - redi [138bc75d-0d04-0410-961f-82ee72b054a4] - 30 May 2019 19:48 EDT

This only change the cxx11 basic_string, because COW strings don't correctly propagate allocators anyway.

2019-05-30 Nina Dinka Ranns



- include/bits/basic_string.tcc [_GLIBCXX_USE_CXX11_ABI] (basic_string::_M_replace_dispatch): Construct temporary string with the current allocator.
- testsuite/21_strings/basic_string/allocator/char/lwg2788.cc: New.
- testsuite/21_strings/basic_string/allocator/wchar_t/lwg2788.cc: New.

01cad9ee79e LWG2788 basic_string spurious use of a default constructible allocator
libstdc++-v3/ChangeLog | 9 +++
libstdc++-v3/include/bits/basic_string.tcc | 4 +-
.../basic_string/allocator/char/lwg2788.cc | 85 ++++++++++++++++++++++
.../basic_string/allocator/wchar_t/lwg2788.cc | 85 ++++++++++++++++++++++
4 files changed, 182 insertions(+), 1 deletion(-)

Upstream: gcc.gnu.org


  • Share