This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/55409] std::list not properly wrapping access to custom allocator through allocator_traits
- From: "potswa at mac dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 17 Jun 2015 21:20:11 +0000
- Subject: [Bug libstdc++/55409] std::list not properly wrapping access to custom allocator through allocator_traits
- Auto-submitted: auto-generated
- References: <bug-55409-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55409
--- Comment #13 from David Krauss <potswa at mac dot com> ---
Nice!
Just a few things:
1. Line 304: rebind isnât an official member of allocator_traits. Prefer
rebind_alloc.
2. _M_put_node is assuming no fancy pointers: its parameter is a
_Node_alloc_traits::pointer but its argument is a _Node*. I think the intent
with fancy pointers is that they get stored in nodes, but doing so would change
the ABI for fancy pointers that implicitly convert to raw. Perhaps thatâs
acceptable, with these sweeping changes?
3. Line 554: should call _Node_alloc_traits::construct. (This breaks allocators
which need a rebind to do construction, but so does the C++11 standard. To be
both backward- and forward-compatible would require rebinding, converting,
constructing via traits, converting back, and assigning. According to my
reading, anyway.) For what itâs worth, the revision already uses
_Node_alloc_traits::destroy, although thatâs customized less in practice.