]> git.ipfire.org Git - thirdparty/gcc.git/commit
Add allocator-extended copy/move ctors to COW string
authorredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 4 Jan 2019 23:23:17 +0000 (23:23 +0000)
committerredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 4 Jan 2019 23:23:17 +0000 (23:23 +0000)
commit859e6fedda51ebeb65a34be08deef0fef421e610
tree54527e7c8dc67c9cd50c70d5984fd46cef111975
parent3910b703bd070d36d00312566e1e60c6f345d1d7
Add allocator-extended copy/move ctors to COW string

Add these constructors from C++11 which were missing from the COW
basic_string. Additionally simplify the definitions of the
basic_string::reference and basic_string::const_reference types as
required by C++11.

This allows filesystem::path::string<Allocator>() to be simplified, so
that the same code is used for both basic_string implementations.

* config/abi/pre/gnu.ver (GLIBCXX_3.4.26): Export allocator-extended
copy/move constructors for old std::basic_string.
* include/bits/basic_string.h [!_GLIBCXX_USE_CXX11_ABI]
(basic_string::reference, basic_string::const_reference): Define
as plain references for C++11 and later.
(basic_string::basic_string()): Put constructor body outside
preprocessor conditional groups.
(basic_string::basic_string(basic_string&&)): Move _Alloc_hider
instead of copying it.
(basic_string::basic_string(const basic_string&, const _Alloc&)):
Define.
(basic_string::basic_string(basic_string&&, const _Alloc&)):
Define.
* include/bits/fs_path.h [!_GLIBCXX_USE_CXX11_ABI]: Remove special
cases for old basic_string.
* testsuite/21_strings/basic_string/cons/char/8.cc: Test
allocator-extended constructors unconditionally. Add extra members to
allocator type when using old string ABI.
* testsuite/21_strings/basic_string/allocator/71964.cc: Enable test
for old string ABI.
* testsuite/21_strings/basic_string/cons/wchar_t/8.cc: Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@267584 138bc75d-0d04-0410-961f-82ee72b054a4
libstdc++-v3/ChangeLog
libstdc++-v3/config/abi/pre/gnu.ver
libstdc++-v3/include/bits/basic_string.h
libstdc++-v3/include/bits/fs_path.h
libstdc++-v3/testsuite/21_strings/basic_string/allocator/71964.cc
libstdc++-v3/testsuite/21_strings/basic_string/cons/char/8.cc
libstdc++-v3/testsuite/21_strings/basic_string/cons/wchar_t/8.cc