forward_list.h (_Fwd_list_node_base::swap): Remove.

2010-10-25  Paolo Carlini  <paolo.carlini@oracle.com>

	* 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.

From-SVN: r165915
This commit is contained in:
Paolo Carlini 2010-10-25 10:47:19 +00:00 committed by Paolo Carlini
parent 35a382b82d
commit deaf7b86cd
6 changed files with 36 additions and 17 deletions

View File

@ -1,3 +1,23 @@
2010-10-25 Paolo Carlini <paolo.carlini@oracle.com>
* 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 <paolo.carlini@oracle.com>
* include/bits/hashtable.h (_Hashtable<>:_M_get_Value_allocator):

View File

@ -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<const _Node_alloc_type*>(&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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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