From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 605 invoked by alias); 17 Jun 2015 20:37:21 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 130920 invoked by uid 55); 17 Jun 2015 20:37:17 -0000 From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/55409] std::list not properly wrapping access to custom allocator through allocator_traits Date: Wed, 17 Jun 2015 20:37:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 4.7.2 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: redi at gcc dot gnu.org X-Bugzilla-Target-Milestone: 6.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-06/txt/msg01581.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55409 --- Comment #12 from Jonathan Wakely --- Author: redi Date: Wed Jun 17 20:36:42 2015 New Revision: 224580 URL: https://gcc.gnu.org/viewcvs?rev=224580&root=gcc&view=rev Log: C++11 allocator support for std::list. PR libstdc++/55409 * include/bits/list.tcc (_List_base::_M_clear()): Use allocator traits. (list::list(const list&)): Use allocator propagation trait. Use _M_assign_dispatch to copy elements. * include/bits/stl_list.h (_List_node): Use __aligned_membuf in C++11. (_List_node::_M_valptr()): Add accessor for stored value. (_List_iterator, _List_const_iterator, _List_base): Use _M_valptr(). (_List_base, list): Use allocator traits. (_List_base::_M_get_Tp_allocator, _List_base::get_allocator): Remove. (_List_base::_M_move_nodes): New function. (_List_base(_List_base&&)): Use _M_move_nodes. (_List_base(_List_base&&, _Node_alloc_type&&)): New constructor. (list::_M_create_node, list::_M_erase, list::max_size): Use allocator traits. (list(size_type)): Add allocator parameter. (list(const list&)): Use allocator propagation trait. (list(const list&, const allocator_type&)): New constructor. (list(list&&, const allocator_type&)): Likewise. (list::operator=(list&&), list::swap(list&)): Use allocator propagation traits. (list::_M_move_assign): New functions. * include/debug/list: Add allocator-extended constructors. * include/profile/list: Likewise. * python/libstdcxx/v6/printers.py (get_value_from_list_node): New function to get value from _List_node. (StdListPrinter): Use get_value_from_list_node. * testsuite/23_containers/list/allocator/copy.cc: New. * testsuite/23_containers/list/allocator/copy_assign.cc: New. * testsuite/23_containers/list/allocator/minimal.cc: New. * testsuite/23_containers/list/allocator/move.cc: New. * testsuite/23_containers/list/allocator/move_assign.cc: New. * testsuite/23_containers/list/allocator/noexcept.cc: New. * testsuite/23_containers/list/allocator/swap.cc: New. * testsuite/23_containers/list/requirements/dr438/assign_neg.cc: Adjust dg-prune-output line number. * testsuite/23_containers/list/requirements/dr438/constructor_1_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/insert_neg.cc: Likewise. Added: trunk/libstdc++-v3/testsuite/23_containers/list/allocator/ trunk/libstdc++-v3/testsuite/23_containers/list/allocator/copy.cc trunk/libstdc++-v3/testsuite/23_containers/list/allocator/copy_assign.cc trunk/libstdc++-v3/testsuite/23_containers/list/allocator/minimal.cc trunk/libstdc++-v3/testsuite/23_containers/list/allocator/move.cc trunk/libstdc++-v3/testsuite/23_containers/list/allocator/move_assign.cc trunk/libstdc++-v3/testsuite/23_containers/list/allocator/noexcept.cc trunk/libstdc++-v3/testsuite/23_containers/list/allocator/swap.cc Modified: trunk/libstdc++-v3/ChangeLog trunk/libstdc++-v3/include/bits/list.tcc trunk/libstdc++-v3/include/bits/stl_list.h trunk/libstdc++-v3/include/debug/list trunk/libstdc++-v3/include/profile/list trunk/libstdc++-v3/python/libstdcxx/v6/printers.py trunk/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/assign_neg.cc trunk/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/constructor_1_neg.cc trunk/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/insert_neg.cc