From 28707ed9b86633dfb9084ce883fb480024f444cb Mon Sep 17 00:00:00 2001 From: paolo Date: Mon, 25 Oct 2010 10:47:19 +0000 Subject: [PATCH] 2010-10-25 Paolo Carlini * include/bits/forward_list.h (_Fwd_list_node_base::swap): Remove. (_Fwd_list_base<>::_Fwd_list_base(_Fwd_list_base&&), _Fwd_list_base<>::_Fwd_list_base(_Fwd_list_base&&, const _Alloc&)): Don't use swap. (forward_list<>::swap): Just use std::swap. * include/bits/forward_list.h (_Fwd_list_base<>::_Fwd_list_base(), _Fwd_list_base(const _Alloc&)): Don't zero again _M_next. * testsuite/23_containers/forward_list/requirements/dr438/ assign_neg.cc: Adjust dg-error line number. * testsuite/23_containers/forward_list/requirements/dr438/ insert_neg.cc: Likewise. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_2_neg.cc: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@165915 138bc75d-0d04-0410-961f-82ee72b054a4 --- libstdc++-v3/ChangeLog | 20 +++++++++++++++++ libstdc++-v3/include/bits/forward_list.h | 25 +++++++++++----------- .../forward_list/requirements/dr438/assign_neg.cc | 2 +- .../requirements/dr438/constructor_1_neg.cc | 2 +- .../requirements/dr438/constructor_2_neg.cc | 2 +- .../forward_list/requirements/dr438/insert_neg.cc | 2 +- 6 files changed, 36 insertions(+), 17 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 77d5154..ce0944e 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,25 @@ 2010-10-25 Paolo Carlini + * include/bits/forward_list.h (_Fwd_list_node_base::swap): Remove. + (_Fwd_list_base<>::_Fwd_list_base(_Fwd_list_base&&), + _Fwd_list_base<>::_Fwd_list_base(_Fwd_list_base&&, const _Alloc&)): + Don't use swap. + (forward_list<>::swap): Just use std::swap. + + * include/bits/forward_list.h (_Fwd_list_base<>::_Fwd_list_base(), + _Fwd_list_base(const _Alloc&)): Don't zero again _M_next. + + * testsuite/23_containers/forward_list/requirements/dr438/ + assign_neg.cc: Adjust dg-error line number. + * testsuite/23_containers/forward_list/requirements/dr438/ + insert_neg.cc: Likewise. + * testsuite/23_containers/forward_list/requirements/dr438/ + constructor_1_neg.cc: Likewise. + * testsuite/23_containers/forward_list/requirements/dr438/ + constructor_2_neg.cc: Likewise. + +2010-10-25 Paolo Carlini + * include/bits/hashtable.h (_Hashtable<>:_M_get_Value_allocator): Remove, unused. diff --git a/libstdc++-v3/include/bits/forward_list.h b/libstdc++-v3/include/bits/forward_list.h index 2b7ec70..845090e 100644 --- a/libstdc++-v3/include/bits/forward_list.h +++ b/libstdc++-v3/include/bits/forward_list.h @@ -47,10 +47,6 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D) _Fwd_list_node_base* _M_next; - static void - swap(_Fwd_list_node_base& __x, _Fwd_list_node_base& __y) - { std::swap(__x._M_next, __y._M_next); } - _Fwd_list_node_base* _M_transfer_after(_Fwd_list_node_base* __begin) { @@ -309,24 +305,26 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D) { return *static_cast(&this->_M_impl); } _Fwd_list_base() - : _M_impl() - { this->_M_impl._M_head._M_next = 0; } + : _M_impl() { } _Fwd_list_base(const _Alloc& __a) - : _M_impl(__a) - { this->_M_impl._M_head._M_next = 0; } + : _M_impl(__a) { } _Fwd_list_base(const _Fwd_list_base& __lst, const _Alloc& __a); _Fwd_list_base(_Fwd_list_base&& __lst, const _Alloc& __a) : _M_impl(__a) - { _Fwd_list_node_base::swap(this->_M_impl._M_head, - __lst._M_impl._M_head); } + { + this->_M_impl._M_head._M_next = __lst._M_impl._M_head._M_next; + __lst._M_impl._M_head._M_next = 0; + } _Fwd_list_base(_Fwd_list_base&& __lst) : _M_impl(__lst._M_get_Node_allocator()) - { _Fwd_list_node_base::swap(this->_M_impl._M_head, - __lst._M_impl._M_head); } + { + this->_M_impl._M_head._M_next = __lst._M_impl._M_head._M_next; + __lst._M_impl._M_head._M_next = 0; + } ~_Fwd_list_base() { _M_erase_after(&_M_impl._M_head, 0); } @@ -979,7 +977,8 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D) */ void swap(forward_list& __list) - { _Node_base::swap(this->_M_impl._M_head, __list._M_impl._M_head); } + { std::swap(this->_M_impl._M_head._M_next, + __list._M_impl._M_head._M_next); } /** * @brief Resizes the %forward_list to the specified number of diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/assign_neg.cc b/libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/assign_neg.cc index fe426e0..2cb45bd 100644 --- a/libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/assign_neg.cc +++ b/libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/assign_neg.cc @@ -1,6 +1,6 @@ // { dg-do compile } // { dg-options "-std=gnu++0x" } -// { dg-error "no matching" "" { target *-*-* } 1204 } +// { dg-error "no matching" "" { target *-*-* } 1203 } // { dg-excess-errors "" } // Copyright (C) 2009, 2010 Free Software Foundation diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/constructor_1_neg.cc b/libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/constructor_1_neg.cc index d4cd3d7..6120bd8 100644 --- a/libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/constructor_1_neg.cc +++ b/libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/constructor_1_neg.cc @@ -1,6 +1,6 @@ // { dg-do compile } // { dg-options "-std=gnu++0x" } -// { dg-error "no matching" "" { target *-*-* } 1204 } +// { dg-error "no matching" "" { target *-*-* } 1203 } // { dg-excess-errors "" } // Copyright (C) 2009, 2010 Free Software Foundation diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/constructor_2_neg.cc b/libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/constructor_2_neg.cc index ac07af2..b253a33 100644 --- a/libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/constructor_2_neg.cc +++ b/libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/constructor_2_neg.cc @@ -1,6 +1,6 @@ // { dg-do compile } // { dg-options "-std=gnu++0x" } -// { dg-error "no matching" "" { target *-*-* } 1204 } +// { dg-error "no matching" "" { target *-*-* } 1203 } // { dg-excess-errors "" } // Copyright (C) 2009, 2010 Free Software Foundation diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/insert_neg.cc b/libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/insert_neg.cc index 06016c7..944a20b 100644 --- a/libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/insert_neg.cc +++ b/libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/insert_neg.cc @@ -1,6 +1,6 @@ // { dg-do compile } // { dg-options "-std=gnu++0x" } -// { dg-error "no matching" "" { target *-*-* } 1204 } +// { dg-error "no matching" "" { target *-*-* } 1203 } // { dg-excess-errors "" } // Copyright (C) 2009, 2010 Free Software Foundation -- 2.7.4