This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/14245] problem with user-defined allocators in std::basic_string
- From: "pcarlini at suse dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 25 Feb 2004 15:53:02 -0000
- Subject: [Bug libstdc++/14245] problem with user-defined allocators in std::basic_string
- References: <20040222194949.14245.cbotev@yahoo.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From pcarlini at suse dot de 2004-02-25 15:53 -------
> What should be improved (notice, *improved* as a QoI issue, the current
> behavior is standard conforming) is what we do for the first argument:
> _M_grab (basing on _Alloc(), and __str.get_allocator()) either calls
> _M_refcopy or _M_clone(__alloc1), that is _M_clone(_Alloc()), that is does
> *not* use the allocator of the new string!
Actually *this* behavior seems wrong, not just a QoI issue. Bad things can
happen at deallocation time, when the real allocator of the string will be
used...
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14245