re PR libstdc++/14245 ([3.4 only] problem with user-defined allocators in std::basic_string)

2004-03-28  Chavdar Botev  <cbotev@yahoo.com>

	PR libstdc++/14245
	* include/bits/basic_string.tcc
	(basic_string::basic_string(const basic_string&)): Pass to
	_Rep::_M_grab the actual allocator of the string being constructed
	not the default constructed one.

From-SVN: r80041
This commit is contained in:
Chavdar Botev 2004-03-28 16:27:27 +00:00 committed by Paolo Carlini
parent e20f3dd143
commit f26e5597f0
2 changed files with 11 additions and 2 deletions

View File

@ -1,3 +1,11 @@
2004-03-28 Chavdar Botev <cbotev@yahoo.com>
PR libstdc++/14245
* include/bits/basic_string.tcc
(basic_string::basic_string(const basic_string&)): Pass to
_Rep::_M_grab the actual allocator of the string being constructed
not the default constructed one.
2004-03-27 Benjamin Kosnik <bkoz@redhat.com>
libstdc++ PR/13598

View File

@ -178,8 +178,9 @@ namespace std
template<typename _CharT, typename _Traits, typename _Alloc>
basic_string<_CharT, _Traits, _Alloc>::
basic_string(const basic_string& __str)
: _M_dataplus(__str._M_rep()->_M_grab(_Alloc(), __str.get_allocator()),
__str.get_allocator())
: _M_dataplus(__str._M_rep()->_M_grab(_Alloc(__str.get_allocator()),
__str.get_allocator()),
__str.get_allocator())
{ }
template<typename _CharT, typename _Traits, typename _Alloc>