2010-10-25 Paolo Carlini <paolo.carlini@oracle.com>
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 25 Oct 2010 10:47:19 +0000 (10:47 +0000)
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 25 Oct 2010 10:47:19 +0000 (10:47 +0000)
* 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
libstdc++-v3/include/bits/forward_list.h
libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/assign_neg.cc
libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/constructor_1_neg.cc
libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/constructor_2_neg.cc
libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/insert_neg.cc

index 77d5154..ce0944e 100644 (file)
@@ -1,5 +1,25 @@
 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):
        Remove, unused.
 
index 2b7ec70..845090e 100644 (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
index fe426e0..2cb45bd 100644 (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
index d4cd3d7..6120bd8 100644 (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
index ac07af2..b253a33 100644 (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
index 06016c7..944a20b 100644 (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