PR libstdc++/79254 fix exception-safety in std::string::operator=
authorJonathan Wakely <jwakely@redhat.com>
Fri, 27 Jan 2017 16:17:04 +0000 (16:17 +0000)
committerJonathan Wakely <redi@gcc.gnu.org>
Fri, 27 Jan 2017 16:17:04 +0000 (16:17 +0000)
commita7d47f352663d16c12cb3a40459b546d166023d7
treecf112fca8fe937bfad8a4ba585c171cccc678a55
parentf75bbf3fc68e1e03b55ae1f60c861faf213968ab
PR libstdc++/79254 fix exception-safety in std::string::operator=

PR libstdc++/79254
* config/abi/pre/gnu.ver: Add new symbols.
* include/bits/basic_string.h [_GLIBCXX_USE_CXX11_ABI]
(basic_string::_M_copy_assign): New overloaded functions to perform
copy assignment.
(basic_string::operator=(const basic_string&)): Dispatch to
_M_copy_assign.
* include/bits/basic_string.tcc [_GLIBCXX_USE_CXX11_ABI]
(basic_string::_M_copy_assign(const basic_string&, true_type)):
Define, performing rollback on exception.
* testsuite/21_strings/basic_string/allocator/char/copy_assign.cc:
Test exception-safety guarantee.
* testsuite/21_strings/basic_string/allocator/wchar_t/copy_assign.cc:
Likewise.
* testsuite/util/testsuite_allocator.h (uneq_allocator::swap): Make
std::swap visible.

From-SVN: r244986
libstdc++-v3/ChangeLog
libstdc++-v3/config/abi/pre/gnu.ver
libstdc++-v3/include/bits/basic_string.h
libstdc++-v3/include/bits/basic_string.tcc
libstdc++-v3/testsuite/21_strings/basic_string/allocator/char/copy_assign.cc
libstdc++-v3/testsuite/21_strings/basic_string/allocator/wchar_t/copy_assign.cc
libstdc++-v3/testsuite/util/testsuite_allocator.h