]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
set.h: Protect move assignment operator vs self assignment.
authorPaolo Carlini <paolo.carlini@oracle.com>
Sat, 9 Jan 2010 02:49:53 +0000 (02:49 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Sat, 9 Jan 2010 02:49:53 +0000 (02:49 +0000)
2010-01-08  Paolo Carlini  <paolo.carlini@oracle.com>

* include/debug/set.h: Protect move assignment operator vs self
assignment.
* include/debug/unordered_map: Likewise.
  * include/debug/multiset.h: Likewise.
  * include/debug/vector: Likewise.
* include/debug/unordered_set: Likewise.
* include/debug/deque: Likewise.
* include/debug/map.h: Likewise.
* include/debug/list: Likewise.
* include/debug/multimap.h: Likewise.
* include/tr1_impl/unordered_map: Likewise.
* include/tr1_impl/unordered_set: Likewise.
* include/profile/set.h: Likewise.
* include/profile/unordered_map: Likewise.
* include/profile/multiset.h: Likewise.
* include/profile/unordered_set: Likewise.
* include/profile/vector: Likewise.
* include/profile/deque: Likewise.
* include/profile/map.h: Likewise.
* include/profile/list: Likewise.
* include/profile/multimap.h: Likewise.
* include/ext/vstring.h: Likewise.
* include/bits/stl_list.h: Likewise.
* include/bits/stl_map.h: Likewise.
* include/bits/stl_set.h: Likewise.
* include/bits/stl_multimap.h: Likewise.
* include/bits/stl_vector.h: Likewise.
* include/bits/stl_deque.h: Likewise.
* include/bits/stl_multiset.h: Likewise.
* include/ext/vstring.h: Use clear().
* testsuite/ext/vstring/cons/self_move_assign.cc: New.
* testsuite/23_containers/unordered_map/cons/self_move_assign.cc:
Likewise.
* testsuite/23_containers/multimap/cons/self_move_assign.cc: Likewise.
* testsuite/23_containers/set/cons/self_move_assign.cc: Likewise.
* testsuite/23_containers/unordered_multimap/cons/
self_move_assign.cc: Likewise.
* testsuite/23_containers/forward_list/cons/self_move_assign.cc:
Likewise.
* testsuite/23_containers/unordered_set/cons/self_move_assign.cc:
Likewise.
  * testsuite/23_containers/vector/cons/self_move_assign.cc: Likewise.
* testsuite/23_containers/deque/cons/self_move_assign.cc: Likewise.
* testsuite/23_containers/multiset/cons/self_move_assign.cc: Likewise.
* testsuite/23_containers/list/cons/self_move_assign.cc: Likewise.
* testsuite/23_containers/unordered_multiset/cons/
self_move_assign.cc: Likewise.
* testsuite/23_containers/map/cons/self_move_assign.cc: Likewise.

* testsuite/23_containers/vector/requirements/dr438/assign_neg.cc:
Adjust dg-error line numbers.
  * testsuite/23_containers/vector/requirements/dr438/insert_neg.cc:
Likewise.
  * testsuite/23_containers/vector/requirements/dr438/
constructor_1_neg.cc: Likewise.
* testsuite/23_containers/vector/requirements/dr438/
constructor_2_neg.cc: Likewise.
* testsuite/23_containers/deque/requirements/dr438/assign_neg.cc:
Likewise.
* testsuite/23_containers/deque/requirements/dr438/insert_neg.cc:
Likewise.
* testsuite/23_containers/deque/requirements/dr438/
constructor_1_neg.cc: Likewise.
* testsuite/23_containers/deque/requirements/dr438/
constructor_2_neg.cc: Likewise.
* testsuite/23_containers/list/requirements/dr438/assign_neg.cc:
Likewise.
* testsuite/23_containers/list/requirements/dr438/insert_neg.cc:
Likewise.
* testsuite/23_containers/list/requirements/dr438/
constructor_1_neg.cc: Likewise.
* testsuite/23_containers/list/requirements/dr438/
constructor_2_neg.cc: Likewise.

* testsuite/ext/vstring/moveable.cc: Move to...
* testsuite/ext/vstring/cons/moveable.cc: ... here.
* testsuite/23_containers/unordered_map/moveable.cc: Move to...
* testsuite/23_containers/unordered_map/cons/moveable.cc ... here.
* testsuite/23_containers/multimap/moveable.cc: Move to...
* testsuite/23_containers/multimap/cons/moveable.cc: ... here.
* testsuite/23_containers/set/moveable.cc: Move to...
* testsuite/23_containers/set/cons/moveable.cc: ... here.
* testsuite/23_containers/unordered_multimap/moveable.cc: Move to...
* testsuite/23_containers/unordered_multimap/cons/moveable.cc:
... here.
* testsuite/23_containers/forward_list/moveable.cc: Move to...
* testsuite/23_containers/forward_list/cons/moveable.cc: ... here.
* testsuite/23_containers/unordered_set/moveable.cc Move to...
* testsuite/23_containers/unordered_set/moveable.cc: ... here.
* testsuite/23_containers/vector/cons/moveable.cc Move to...
* testsuite/23_containers/vector/cons/moveable2.cc: ... this.
* testsuite/23_containers/deque/cons/moveable.cc Move to...
* testsuite/23_containers/deque/cons/moveable2.cc: ... this.
* testsuite/23_containers/multiset/moveable.cc Move to...
* testsuite/23_containers/multiset/cons/moveable.cc: ... here.
* testsuite/23_containers/list/moveable.h Move to...
* testsuite/23_containers/list/cons/moveable.h: ... here.
* testsuite/23_containers/list/moveable.cc Move to...
* testsuite/23_containers/list/cons/moveable.cc: ... here.
* testsuite/23_containers/unordered_multiset/moveable.cc Move to...
* testsuite/23_containers/unordered_multiset/cons/moveable.cc:
... here.
* testsuite/23_containers/map/moveable.cc Move to...
* testsuite/23_containers/map/cons/moveable.cc: ... here.
* testsuite/23_containers/vector/moveable.cc: Move to...
* testsuite/23_containers/vector/cons/moveable.cc: ... here.
* testsuite/23_containers/deque/moveable.cc: Move to...
* testsuite/23_containers/deque/cons/moveable.cc: ... here.

From-SVN: r155754

70 files changed:
libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/stl_deque.h
libstdc++-v3/include/bits/stl_list.h
libstdc++-v3/include/bits/stl_map.h
libstdc++-v3/include/bits/stl_multimap.h
libstdc++-v3/include/bits/stl_multiset.h
libstdc++-v3/include/bits/stl_set.h
libstdc++-v3/include/bits/stl_vector.h
libstdc++-v3/include/debug/deque
libstdc++-v3/include/debug/list
libstdc++-v3/include/debug/map.h
libstdc++-v3/include/debug/multimap.h
libstdc++-v3/include/debug/multiset.h
libstdc++-v3/include/debug/set.h
libstdc++-v3/include/debug/unordered_map
libstdc++-v3/include/debug/unordered_set
libstdc++-v3/include/debug/vector
libstdc++-v3/include/ext/vstring.h
libstdc++-v3/include/profile/deque
libstdc++-v3/include/profile/list
libstdc++-v3/include/profile/map.h
libstdc++-v3/include/profile/multimap.h
libstdc++-v3/include/profile/multiset.h
libstdc++-v3/include/profile/set.h
libstdc++-v3/include/profile/unordered_map
libstdc++-v3/include/profile/unordered_set
libstdc++-v3/include/profile/vector
libstdc++-v3/include/tr1_impl/unordered_map
libstdc++-v3/include/tr1_impl/unordered_set
libstdc++-v3/testsuite/23_containers/deque/cons/moveable.cc
libstdc++-v3/testsuite/23_containers/deque/cons/moveable2.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/deque/cons/self_move_assign.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/assign_neg.cc
libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/constructor_1_neg.cc
libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/constructor_2_neg.cc
libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/insert_neg.cc
libstdc++-v3/testsuite/23_containers/forward_list/cons/moveable.cc [moved from libstdc++-v3/testsuite/23_containers/forward_list/moveable.cc with 100% similarity]
libstdc++-v3/testsuite/23_containers/forward_list/cons/self_move_assign.cc [moved from libstdc++-v3/testsuite/23_containers/deque/moveable.cc with 65% similarity]
libstdc++-v3/testsuite/23_containers/list/cons/moveable.cc [moved from libstdc++-v3/testsuite/23_containers/list/moveable.cc with 100% similarity]
libstdc++-v3/testsuite/23_containers/list/cons/moveable.h [moved from libstdc++-v3/testsuite/23_containers/list/moveable.h with 100% similarity]
libstdc++-v3/testsuite/23_containers/list/cons/self_move_assign.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/list/requirements/dr438/assign_neg.cc
libstdc++-v3/testsuite/23_containers/list/requirements/dr438/constructor_1_neg.cc
libstdc++-v3/testsuite/23_containers/list/requirements/dr438/constructor_2_neg.cc
libstdc++-v3/testsuite/23_containers/list/requirements/dr438/insert_neg.cc
libstdc++-v3/testsuite/23_containers/map/cons/moveable.cc [moved from libstdc++-v3/testsuite/23_containers/map/moveable.cc with 100% similarity]
libstdc++-v3/testsuite/23_containers/map/cons/self_move_assign.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/multimap/cons/moveable.cc [moved from libstdc++-v3/testsuite/23_containers/multimap/moveable.cc with 100% similarity]
libstdc++-v3/testsuite/23_containers/multimap/cons/self_move_assign.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/multiset/cons/moveable.cc [moved from libstdc++-v3/testsuite/23_containers/multiset/moveable.cc with 100% similarity]
libstdc++-v3/testsuite/23_containers/multiset/cons/self_move_assign.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/set/cons/moveable.cc [moved from libstdc++-v3/testsuite/23_containers/set/moveable.cc with 100% similarity]
libstdc++-v3/testsuite/23_containers/set/cons/self_move_assign.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/unordered_map/cons/moveable.cc [moved from libstdc++-v3/testsuite/23_containers/unordered_map/moveable.cc with 100% similarity]
libstdc++-v3/testsuite/23_containers/unordered_map/cons/self_move_assign.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/unordered_multimap/cons/moveable.cc [moved from libstdc++-v3/testsuite/23_containers/unordered_multimap/moveable.cc with 100% similarity]
libstdc++-v3/testsuite/23_containers/unordered_multimap/cons/self_move_assign.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/unordered_multiset/cons/moveable.cc [moved from libstdc++-v3/testsuite/23_containers/unordered_multiset/moveable.cc with 100% similarity]
libstdc++-v3/testsuite/23_containers/unordered_multiset/cons/self_move_assign.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/unordered_set/cons/moveable.cc [moved from libstdc++-v3/testsuite/23_containers/unordered_set/moveable.cc with 100% similarity]
libstdc++-v3/testsuite/23_containers/unordered_set/cons/self_move_assign.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/vector/cons/moveable.cc
libstdc++-v3/testsuite/23_containers/vector/cons/moveable2.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/vector/cons/self_move_assign.cc [moved from libstdc++-v3/testsuite/23_containers/vector/moveable.cc with 52% similarity]
libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/assign_neg.cc
libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_1_neg.cc
libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_2_neg.cc
libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/insert_neg.cc
libstdc++-v3/testsuite/ext/vstring/cons/moveable.cc [moved from libstdc++-v3/testsuite/ext/vstring/moveable.cc with 100% similarity]
libstdc++-v3/testsuite/ext/vstring/cons/self_move_assign.cc [new file with mode: 0644]

index 11e38434525d2c4a1bbd536c9a2945d9206cb3af..fe5de4369712e92636d55ed4737b352969e25d03 100644 (file)
@@ -1,3 +1,114 @@
+2010-01-08  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       * include/debug/set.h: Protect move assignment operator vs self
+       assignment.
+       * include/debug/unordered_map: Likewise.
+       * include/debug/multiset.h: Likewise.
+       * include/debug/vector: Likewise.
+       * include/debug/unordered_set: Likewise.
+       * include/debug/deque: Likewise.
+       * include/debug/map.h: Likewise.
+       * include/debug/list: Likewise.
+       * include/debug/multimap.h: Likewise.
+       * include/tr1_impl/unordered_map: Likewise.
+       * include/tr1_impl/unordered_set: Likewise.
+       * include/profile/set.h: Likewise.
+       * include/profile/unordered_map: Likewise.
+       * include/profile/multiset.h: Likewise.
+       * include/profile/unordered_set: Likewise.
+       * include/profile/vector: Likewise.
+       * include/profile/deque: Likewise.
+       * include/profile/map.h: Likewise.
+       * include/profile/list: Likewise.
+       * include/profile/multimap.h: Likewise.
+       * include/ext/vstring.h: Likewise.
+       * include/bits/stl_list.h: Likewise.
+       * include/bits/stl_map.h: Likewise.
+       * include/bits/stl_set.h: Likewise.
+       * include/bits/stl_multimap.h: Likewise.
+       * include/bits/stl_vector.h: Likewise.
+       * include/bits/stl_deque.h: Likewise.
+       * include/bits/stl_multiset.h: Likewise.
+       * include/ext/vstring.h: Use clear().
+       * testsuite/ext/vstring/cons/self_move_assign.cc: New.
+       * testsuite/23_containers/unordered_map/cons/self_move_assign.cc:
+       Likewise.
+       * testsuite/23_containers/multimap/cons/self_move_assign.cc: Likewise.
+       * testsuite/23_containers/set/cons/self_move_assign.cc: Likewise.
+       * testsuite/23_containers/unordered_multimap/cons/
+       self_move_assign.cc: Likewise.
+       * testsuite/23_containers/forward_list/cons/self_move_assign.cc:
+       Likewise.
+       * testsuite/23_containers/unordered_set/cons/self_move_assign.cc:
+       Likewise.
+       * testsuite/23_containers/vector/cons/self_move_assign.cc: Likewise.
+       * testsuite/23_containers/deque/cons/self_move_assign.cc: Likewise.
+       * testsuite/23_containers/multiset/cons/self_move_assign.cc: Likewise.
+       * testsuite/23_containers/list/cons/self_move_assign.cc: Likewise.
+       * testsuite/23_containers/unordered_multiset/cons/
+       self_move_assign.cc: Likewise.
+       * testsuite/23_containers/map/cons/self_move_assign.cc: Likewise.
+
+       * testsuite/23_containers/vector/requirements/dr438/assign_neg.cc:
+       Adjust dg-error line numbers.
+       * testsuite/23_containers/vector/requirements/dr438/insert_neg.cc:
+       Likewise.
+       * testsuite/23_containers/vector/requirements/dr438/
+       constructor_1_neg.cc: Likewise.
+       * testsuite/23_containers/vector/requirements/dr438/
+       constructor_2_neg.cc: Likewise.
+       * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc:
+       Likewise.
+       * testsuite/23_containers/deque/requirements/dr438/insert_neg.cc:
+       Likewise.
+       * testsuite/23_containers/deque/requirements/dr438/
+       constructor_1_neg.cc: Likewise.
+       * testsuite/23_containers/deque/requirements/dr438/
+       constructor_2_neg.cc: Likewise.
+       * testsuite/23_containers/list/requirements/dr438/assign_neg.cc:
+       Likewise.
+       * testsuite/23_containers/list/requirements/dr438/insert_neg.cc:
+       Likewise.
+       * testsuite/23_containers/list/requirements/dr438/
+       constructor_1_neg.cc: Likewise.
+       * testsuite/23_containers/list/requirements/dr438/
+       constructor_2_neg.cc: Likewise.
+
+       * testsuite/ext/vstring/moveable.cc: Move to...
+       * testsuite/ext/vstring/cons/moveable.cc: ... here.
+       * testsuite/23_containers/unordered_map/moveable.cc: Move to...
+       * testsuite/23_containers/unordered_map/cons/moveable.cc ... here.
+       * testsuite/23_containers/multimap/moveable.cc: Move to...
+       * testsuite/23_containers/multimap/cons/moveable.cc: ... here.
+       * testsuite/23_containers/set/moveable.cc: Move to...
+       * testsuite/23_containers/set/cons/moveable.cc: ... here.
+       * testsuite/23_containers/unordered_multimap/moveable.cc: Move to...
+       * testsuite/23_containers/unordered_multimap/cons/moveable.cc:
+       ... here.
+       * testsuite/23_containers/forward_list/moveable.cc: Move to...
+       * testsuite/23_containers/forward_list/cons/moveable.cc: ... here.
+       * testsuite/23_containers/unordered_set/moveable.cc Move to...
+       * testsuite/23_containers/unordered_set/moveable.cc: ... here.
+       * testsuite/23_containers/vector/cons/moveable.cc Move to...
+       * testsuite/23_containers/vector/cons/moveable2.cc: ... this.
+       * testsuite/23_containers/deque/cons/moveable.cc Move to...
+       * testsuite/23_containers/deque/cons/moveable2.cc: ... this.
+       * testsuite/23_containers/multiset/moveable.cc Move to...
+       * testsuite/23_containers/multiset/cons/moveable.cc: ... here.
+       * testsuite/23_containers/list/moveable.h Move to...
+       * testsuite/23_containers/list/cons/moveable.h: ... here.
+       * testsuite/23_containers/list/moveable.cc Move to...
+       * testsuite/23_containers/list/cons/moveable.cc: ... here.
+       * testsuite/23_containers/unordered_multiset/moveable.cc Move to...
+       * testsuite/23_containers/unordered_multiset/cons/moveable.cc:
+       ... here.
+       * testsuite/23_containers/map/moveable.cc Move to...
+       * testsuite/23_containers/map/cons/moveable.cc: ... here.
+       * testsuite/23_containers/vector/moveable.cc: Move to...
+       * testsuite/23_containers/vector/cons/moveable.cc: ... here.
+       * testsuite/23_containers/deque/moveable.cc: Move to...
+       * testsuite/23_containers/deque/cons/moveable.cc: ... here.
+
 2010-01-08  Paolo Carlini  <paolo.carlini@oracle.com>
 
        PR libstdc++/42573
index d327fc2f20272d2530144fc3275363f66ff23ab0..b0b2f4940d84cb585a169e53eec1129bf373558a 100644 (file)
@@ -884,9 +884,12 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
       deque&
       operator=(deque&& __x)
       {
-       // NB: DR 675.
-       this->clear();
-       this->swap(__x); 
+       if (this != &__x)
+         {
+           // NB: DR 675.
+           this->clear();
+           this->swap(__x);
+         } 
        return *this;
       }
 
index 51f8a8f931dfeeb506c862c4b15bb085f47cb341..b6ce11382efe1965ed5670c1bbf50a65a4206a01 100644 (file)
@@ -1,6 +1,6 @@
 // List implementation -*- C++ -*-
 
-// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
 // Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
@@ -606,9 +606,12 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
       list&
       operator=(list&& __x)
       {
-       // NB: DR 675.
-       this->clear();
-       this->swap(__x); 
+       if (this != &__x)
+         {
+           // NB: DR 675.
+           this->clear();
+           this->swap(__x);
+         }
        return *this;
       }
 
index a26e68a01c0aad700f67f64b9f9873982d92d7a2..33364bfe917fb75db68fd12d85342d8bcf3a82d0 100644 (file)
@@ -1,6 +1,6 @@
 // Map implementation -*- C++ -*-
 
-// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
 // Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
@@ -265,9 +265,12 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
       map&
       operator=(map&& __x)
       {
-       // NB: DR 675.
-       this->clear();
-       this->swap(__x); 
+       if (this != &__x)
+         {
+           // NB: DR 675.
+           this->clear();
+           this->swap(__x);
+         } 
        return *this;
       }
 
index fa3f2539018aa60ff0f217b55463f56cd42fbf11..0bff20a07355f371ed28fc6b1614428e49b2f50d 100644 (file)
@@ -1,6 +1,6 @@
 // Multimap implementation -*- C++ -*-
 
-// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
 // Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
@@ -262,9 +262,12 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
       multimap&
       operator=(multimap&& __x)
       {
-       // NB: DR 675.
-       this->clear();
-       this->swap(__x); 
+       if (this != &__x)
+         {
+           // NB: DR 675.
+           this->clear();
+           this->swap(__x);
+         } 
        return *this;
       }
 
index 431cbae430281297cb7acd184915008ce0b18a82..bb84b6b7d08dc8736af599d118b5ebf82cab117e 100644 (file)
@@ -1,6 +1,6 @@
 // Multiset implementation -*- C++ -*-
 
-// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
 // Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
@@ -234,9 +234,12 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
       multiset&
       operator=(multiset&& __x)
       {
-       // NB: DR 675.
-       this->clear();
-       this->swap(__x); 
+       if (this != &__x)
+         {
+           // NB: DR 675.
+           this->clear();
+           this->swap(__x);
+         }
        return *this;
       }
 
index e87cccbab7715eb635a6eeb64db8c393aec94971..2388382ad316cca064fdac3f4108b25cd58d1895 100644 (file)
@@ -1,6 +1,6 @@
 // Set implementation -*- C++ -*-
 
-// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
 // Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
@@ -241,9 +241,12 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
       set&
       operator=(set&& __x)
       {
-       // NB: DR 675.
-       this->clear();
-       this->swap(__x); 
+       if (this != &__x)
+         {
+           // NB: DR 675.
+           this->clear();
+           this->swap(__x);
+         } 
        return *this;
       }
 
index ab21a94e530bfe4ff2ca77f8c05c189975695375..f681cf0e8554ec00adb0ac804343c77d4e1685f8 100644 (file)
@@ -335,9 +335,12 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
       vector&
       operator=(vector&& __x)
       {
-       // NB: DR 675.
-       this->clear();
-       this->swap(__x); 
+       if (this != &__x)
+         {
+           // NB: DR 675.
+           this->clear();
+           this->swap(__x);
+         } 
        return *this;
       }
 
index bb9aef9302d64ae15de18e15c6fb56b48b04a40a..1c9535ec7568d7d0b9afa5b42bc1dcce9d7ee1c5 100644 (file)
@@ -110,9 +110,12 @@ namespace __debug
       deque&
       operator=(deque&& __x)
       {
-        // NB: DR 675.
-       clear();
-       swap(__x);        
+       if (this != &__x)
+         {
+           // NB: DR 675.
+           clear();
+           swap(__x);
+         }       
        return *this;
       }
 
index 3af008c6b172169835a12af612655eda5b517ca5..78462e459059ff9fea178f35ed2d33de22de0cb2 100644 (file)
@@ -112,9 +112,12 @@ namespace __debug
       list&
       operator=(list&& __x)
       {
-        // NB: DR 675.
-       clear();
-       swap(__x);
+       if (this != &__x)
+         {
+           // NB: DR 675.
+           clear();
+           swap(__x);
+         }
        return *this;
       }
 
index 9a558b594887c075fac1ee491df14b34ef66e10c..8ef28a19790ef9242841e5d59c28371a46e2f583 100644 (file)
@@ -115,9 +115,12 @@ namespace __debug
       map&
       operator=(map&& __x)
       {
-        // NB: DR 675.
-       clear();
-       swap(__x);
+       if (this != &__x)
+         {
+           // NB: DR 675.
+           clear();
+           swap(__x);
+         }
        return *this;
       }
 
index f69a289cf65d378138365b660c42b9abaead9550..4ef2990acd03dba91812d05b6ea8abcab1db982f 100644 (file)
@@ -116,9 +116,12 @@ namespace __debug
       multimap&
       operator=(multimap&& __x)
       {
-        // NB: DR 675.
-       clear();
-       swap(__x);
+       if (this != &__x)
+         {
+           // NB: DR 675.
+           clear();
+           swap(__x);
+         }
        return *this;
       }
 
index 91909826d7a798a166d175aa6cdbd5b665e939e8..4a7ed9e66882aff605d06ba30d8a28b71c67810e 100644 (file)
@@ -113,9 +113,12 @@ namespace __debug
       multiset&
       operator=(multiset&& __x)
       {
-        // NB: DR 675.
-       clear();
-       swap(__x);
+       if (this != &__x)
+         {
+           // NB: DR 675.
+           clear();
+           swap(__x);
+         }
        return *this;
       }
 
index 769639d721bffcc8c3254ff608cc363a5f3dd8c6..99f83fa9aa8db091f4f0cba61a44695143a52092 100644 (file)
@@ -113,9 +113,12 @@ namespace __debug
       set&
       operator=(set&& __x)
       {
-        // NB: DR 675.
-       clear();
-       swap(__x);
+       if (this != &__x)
+         {
+           // NB: DR 675.
+           clear();
+           swap(__x);
+         }
        return *this;
       }
 
index 999dcae58fc1c82c32acd1f8ef67a588d5649d97..61a3a0a3686565c1465a2338c99d52367a8c9e5d 100644 (file)
@@ -1,6 +1,6 @@
 // Debugging unordered_map/unordered_multimap implementation -*- C++ -*-
 
-// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
 // Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
@@ -115,9 +115,12 @@ namespace __debug
       unordered_map&
       operator=(unordered_map&& __x)
       {
-        // NB: DR 675.
-       clear();
-       swap(__x);
+       if (this != &__x)
+         {
+           // NB: DR 675.
+           clear();
+           swap(__x);
+         }
        return *this;
       }
 
@@ -388,9 +391,12 @@ namespace __debug
       unordered_multimap&
       operator=(unordered_multimap&& __x)
       {
-        // NB: DR 675.
-       clear();
-       swap(__x);
+       if (this != &__x)
+         {
+           // NB: DR 675.
+           clear();
+           swap(__x);
+         }
        return *this;
       }
 
index 4f27c3f375dfcf1f12b235b6e3ed1a98caf539cf..f704f0167948b643935047ed33ef47d1daf9b0c6 100644 (file)
@@ -1,6 +1,6 @@
 // Debugging unordered_set/unordered_multiset implementation -*- C++ -*-
 
-// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
 // Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
@@ -115,9 +115,12 @@ namespace __debug
       unordered_set&
       operator=(unordered_set&& __x)
       {
-        // NB: DR 675.
-       clear();
-       swap(__x);
+       if (this != &__x)
+         {
+           // NB: DR 675.
+           clear();
+           swap(__x);
+         }
        return *this;
       }
 
index 67733bca9f9e489c5aab9f5601793051f3b9a0e9..227905a513dec7de805c09e02c4833254a8eb45f 100644 (file)
@@ -124,9 +124,12 @@ namespace __debug
       vector&
       operator=(vector&& __x)
       {
-        // NB: DR 675.
-       clear();
-       swap(__x);
+       if (this != &__x)
+         {
+           // NB: DR 675.
+           clear();
+           swap(__x);
+         }
        return *this;
       }
 
index d1a4afba139928d973089cf0a9cc123fd3d1f705..691915f5c7ffcb2252d68035ac0effa3d87f3688 100644 (file)
@@ -261,7 +261,10 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
       operator=(__versa_string&& __str)
       {
        if (this != &__str)
-         this->swap(__str);
+         {
+           this->clear();
+           this->swap(__str);
+         }
        return *this;
       }
 
index d0859a4aa968fca3a0c62b04f7dbdca1d23b690a..12f45d646fcc8aa6716a5819441305935a186f7f 100644 (file)
@@ -102,9 +102,12 @@ namespace __profile
       deque&
       operator=(deque&& __x)
       {
-        // NB: DR 675.
-       this->clear();
-       this->swap(__x);          
+       if (this != &__x)
+         {
+           // NB: DR 675.
+           this->clear();
+           this->swap(__x);
+         }  
        return *this;
       }
 
index 59a468b6dc8715fa98ca8b05068688efe49ce377..9979a5211b2e84e77d0c7fa046f96cd63fcede66 100644 (file)
@@ -102,9 +102,12 @@ namespace __profile
       list&
       operator=(list&& __x)
       {
-        // NB: DR 675.
-       this->clear();
-       this->swap(__x);
+       if (this != &__x)
+         {
+           // NB: DR 675.
+           this->clear();
+           this->swap(__x);
+         }
        return *this;
       }
 
index baa877db5fe17515fb97a4a9e2c273a93bac6d9d..6335ee774f345493c9900fa5e7dc1eed70a2dac0 100644 (file)
@@ -121,9 +121,12 @@ namespace __profile
       map&
       operator=(map&& __x)
       {
-        // NB: DR 675.
-       this->clear();
-       this->swap(__x);
+       if (this != &__x)
+         {
+           // NB: DR 675.
+           this->clear();
+           this->swap(__x);
+         }
        return *this;
       }
 
index df4e02d93d37b4cf470afb8441470afbb93a8c0c..c240e331aa6ee34bbb7e8e04b62c2dc97e4faed1 100644 (file)
@@ -1,6 +1,6 @@
 // Profiling multimap implementation -*- C++ -*-
 
-// Copyright (C) 2009 Free Software Foundation, Inc.
+// Copyright (C) 2009, 2010 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
@@ -106,9 +106,12 @@ namespace __profile
       multimap&
       operator=(multimap&& __x)
       {
-        // NB: DR 675.
-       this->clear();
-       this->swap(__x);
+       if (this != &__x)
+         {
+           // NB: DR 675.
+           this->clear();
+           this->swap(__x);
+         }
        return *this;
       }
 
index b44abc40aef814b7980b7e06b65564242e7073b4..22c1c53738c0d38d59169460f24664ef28adc9b9 100644 (file)
@@ -104,9 +104,12 @@ namespace __profile
       multiset&
       operator=(multiset&& __x)
       {
-        // NB: DR 675.
-       this->clear();
-       this->swap(__x);
+       if (this != &__x)
+         {
+           // NB: DR 675.
+           this->clear();
+           this->swap(__x);
+         }
        return *this;
       }
 
index 6c6773c134e78cf52e7701d4b34a3977db5e8d5c..c5d462747f7751f4f826978cb0e3c74227f44bca 100644 (file)
@@ -104,9 +104,12 @@ namespace __profile
       set&
       operator=(set&& __x)
       {
-        // NB: DR 675.
-       this->clear();
-       this->swap(__x);
+       if (this != &__x)
+         {
+           // NB: DR 675.
+           this->clear();
+           this->swap(__x);
+         }
        return *this;
       }
 
index b8adc44108b972e16a4311a613e4fc534c259d75..7ef629a9094f54c92732f5c57e00cd180ae43a9c 100644 (file)
@@ -130,9 +130,12 @@ namespace __profile
       unordered_map&
       operator=(unordered_map&& __x)
       {
-        // NB: DR 675.
-       this->clear();
-       this->swap(__x);
+       if (this != &__x)
+         {
+           // NB: DR 675.
+           this->clear();
+           this->swap(__x);
+         }
        return *this;
       }
 
@@ -355,9 +358,12 @@ namespace __profile
       unordered_multimap&
       operator=(unordered_multimap&& __x)
       {
-        // NB: DR 675.
-       this->clear();
-       this->swap(__x);
+       if (this != &__x)
+         {
+           // NB: DR 675.
+           this->clear();
+           this->swap(__x);
+         }
        return *this;
       }
 
index b350da0878e25c794ac4e1bef65a0e62802c6174..8c9e7669c495c5aeef3804dbe1f0b95d7c8313c9 100644 (file)
@@ -129,9 +129,12 @@ namespace __profile
       unordered_set&
       operator=(unordered_set&& __x)
       {
-        // NB: DR 675.
-       this->clear();
-       this->swap(__x);
+       if (this != &__x)
+         {
+           // NB: DR 675.
+           this->clear();
+           this->swap(__x);
+         }
        return *this;
       }
 
@@ -343,9 +346,12 @@ namespace __profile
       unordered_multiset&
       operator=(unordered_multiset&& __x)
       {
-        // NB: DR 675.
-       this->clear();
-       this->swap(__x);
+       if (this != &__x)
+         {
+           // NB: DR 675.
+           this->clear();
+           this->swap(__x);
+         }
        return *this;
       }
 
index 0b1d752693531d2f29bdb5933daf23b628937eca..5ae45323dcb39597c4917aa84bdd48bb4ae1e09e 100644 (file)
@@ -140,9 +140,12 @@ namespace __profile
       vector&
       operator=(vector&& __x)
       {
-        // NB: DR 675.
-        this->clear();
-        this->swap(__x);
+       if (this != &__x)
+         {
+           // NB: DR 675.
+           this->clear();
+           this->swap(__x);
+         }
         return *this;
       }
 
index edf49789fa47b95b001fda6b54ad0ef3cf9ea349..d697590073981d3d9a99c85ac8c6b7ccc42c93b7 100644 (file)
@@ -229,9 +229,12 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1
       unordered_map&
       operator=(unordered_map&& __x)
       {
-       // NB: DR 675.
-       this->clear();
-       this->swap(__x); 
+       if (this != &__x)
+         {
+           // NB: DR 675.
+           this->clear();
+           this->swap(__x);
+         } 
        return *this;   
       }
 
@@ -312,9 +315,12 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1
       unordered_multimap&
       operator=(unordered_multimap&& __x)
       {
-       // NB: DR 675.
-       this->clear();
-       this->swap(__x); 
+       if (this != &__x)
+         {
+           // NB: DR 675.
+           this->clear();
+           this->swap(__x);
+         } 
        return *this;   
       }
 
index d52b1517d9179021753e3f6a1927a9b980a5631e..1270b17186a4ecc545057478c16a10f2e3b811a9 100644 (file)
@@ -1,6 +1,6 @@
 // TR1 unordered_set -*- C++ -*-
 
-// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
@@ -222,9 +222,12 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1
       unordered_set&
       operator=(unordered_set&& __x)
       {
-       // NB: DR 675.
-       this->clear();
-       this->swap(__x); 
+       if (this != &__x)
+         {
+           // NB: DR 675.
+           this->clear();
+           this->swap(__x);
+         } 
        return *this;   
       }
 
@@ -302,9 +305,12 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1
       unordered_multiset&
       operator=(unordered_multiset&& __x)
       {
-       // NB: DR 675.
-       this->clear();
-       this->swap(__x); 
+       if (this != &__x)
+         {
+           // NB: DR 675.
+           this->clear();
+           this->swap(__x);
+         } 
        return *this;   
       }
 
index 2d5edb4c25b285827507ca69cbc7fabc21f9a340..57113f5fb2e5d28430d744a7d3189def740e558b 100644 (file)
@@ -1,4 +1,3 @@
-// { dg-do compile }
 // { dg-options "-std=gnu++0x" }
 
 // Copyright (C) 2005, 2007, 2009 Free Software Foundation, Inc.
 // <http://www.gnu.org/licenses/>.
 
 
-#include <deque>
-#include <iterator>
-#include <testsuite_iterators.h>
-#include <testsuite_rvalref.h>
-
-using namespace __gnu_test;
-typedef std::deque<rvalstruct> test_type;
-
-// Empty constructor doesn't require a copy constructor
-void
-test01()
-{ test_type d; }
-
-// Constructing from a range that returns rvalue references doesn't
-// require a copy constructor.
-void
-test02(rvalstruct* begin, rvalstruct* end)
-{ 
-  test_type d(std::make_move_iterator(begin), std::make_move_iterator(end));
-}
+// NOTE: This makes use of the fact that we know how moveable
+// is implemented on deque (via swap). If the implementation changed
+// this test may begin to fail.
 
-// Constructing from a input iterator range that returns rvalue
-// references doesn't require a copy constructor either.
-void
-test03(input_iterator_wrapper<rvalstruct> begin,
-       input_iterator_wrapper<rvalstruct> end)
-{ 
-  test_type d(std::make_move_iterator(begin), std::make_move_iterator(end));
+#include <deque>
+#include <utility>
+#include <testsuite_hooks.h>
+
+int main()
+{
+  bool test __attribute__((unused)) = true;
+
+  std::deque<int> a,b;
+  a.push_back(1);
+  b = std::move(a);
+  VERIFY( b.size() == 1 && b[0] == 1 && a.size() == 0 );
+
+  std::deque<int> c(std::move(b));
+  VERIFY( c.size() == 1 && c[0] == 1 );
+  VERIFY( b.size() == 0 );
+  return 0;
 }
-
-// Neither does destroying one.
-void
-test04(test_type* d)
-{ delete d; }
diff --git a/libstdc++-v3/testsuite/23_containers/deque/cons/moveable2.cc b/libstdc++-v3/testsuite/23_containers/deque/cons/moveable2.cc
new file mode 100644 (file)
index 0000000..2d5edb4
--- /dev/null
@@ -0,0 +1,55 @@
+// { dg-do compile }
+// { dg-options "-std=gnu++0x" }
+
+// Copyright (C) 2005, 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+
+#include <deque>
+#include <iterator>
+#include <testsuite_iterators.h>
+#include <testsuite_rvalref.h>
+
+using namespace __gnu_test;
+typedef std::deque<rvalstruct> test_type;
+
+// Empty constructor doesn't require a copy constructor
+void
+test01()
+{ test_type d; }
+
+// Constructing from a range that returns rvalue references doesn't
+// require a copy constructor.
+void
+test02(rvalstruct* begin, rvalstruct* end)
+{ 
+  test_type d(std::make_move_iterator(begin), std::make_move_iterator(end));
+}
+
+// Constructing from a input iterator range that returns rvalue
+// references doesn't require a copy constructor either.
+void
+test03(input_iterator_wrapper<rvalstruct> begin,
+       input_iterator_wrapper<rvalstruct> end)
+{ 
+  test_type d(std::make_move_iterator(begin), std::make_move_iterator(end));
+}
+
+// Neither does destroying one.
+void
+test04(test_type* d)
+{ delete d; }
diff --git a/libstdc++-v3/testsuite/23_containers/deque/cons/self_move_assign.cc b/libstdc++-v3/testsuite/23_containers/deque/cons/self_move_assign.cc
new file mode 100644 (file)
index 0000000..e3c5180
--- /dev/null
@@ -0,0 +1,40 @@
+// { dg-options "-std=gnu++0x" }
+
+// 2010-01-08  Paolo Carlini  <paolo.carlini@oracle.com>
+
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <deque>
+#include <testsuite_hooks.h>
+
+void test01()
+{
+  bool test __attribute__((unused)) = true;
+
+  std::deque<int> d0(10, 1);
+  const std::deque<int> d1(d0);
+  d0 = std::move(d0);
+  VERIFY( d0.size() == 10 );
+  VERIFY( d0 == d1 );
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
index 0ab463da8216e02639cb6a8983847cf0e58beb56..0a50b6d922051a90338901581f1cf1b384e56609 100644 (file)
@@ -18,7 +18,7 @@
 // <http://www.gnu.org/licenses/>.
 
 // { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1575 }
+// { dg-error "no matching" "" { target *-*-* } 1578 }
 // { dg-excess-errors "" }
 
 #include <deque>
index f5265634130e2ed6d5bcde96cd0ee08bfa6148e2..a63fcfa5ea60ce4b1efd9ca72ec9cf434563181b 100644 (file)
@@ -18,7 +18,7 @@
 // <http://www.gnu.org/licenses/>.
 
 // { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1514 }
+// { dg-error "no matching" "" { target *-*-* } 1517 }
 // { dg-excess-errors "" }
 
 #include <deque>
index 4ef1fc1b92d8e05d4f49d6b9c13a771ab2468d03..298ec2de53297ed63f1dde5a3118e4533aba04b2 100644 (file)
@@ -18,7 +18,7 @@
 // <http://www.gnu.org/licenses/>.
 
 // { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1514 }
+// { dg-error "no matching" "" { target *-*-* } 1517 }
 // { dg-excess-errors "" }
 
 #include <deque>
index df837568c6880375c2b2ab3fcbb5bbdfbd04f81d..cb303949ac8e46dcc3e612891759496a1ee8eac1 100644 (file)
@@ -18,7 +18,7 @@
 // <http://www.gnu.org/licenses/>.
 
 // { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1659 }
+// { dg-error "no matching" "" { target *-*-* } 1662 }
 // { dg-excess-errors "" }
 
 #include <deque>
similarity index 65%
rename from libstdc++-v3/testsuite/23_containers/deque/moveable.cc
rename to libstdc++-v3/testsuite/23_containers/forward_list/cons/self_move_assign.cc
index 57113f5fb2e5d28430d744a7d3189def740e558b..d7b7298c67fa247df4d755f09c733023d06dc88b 100644 (file)
@@ -1,6 +1,8 @@
 // { dg-options "-std=gnu++0x" }
 
-// Copyright (C) 2005, 2007, 2009 Free Software Foundation, Inc.
+// 2010-01-08  Paolo Carlini  <paolo.carlini@oracle.com>
+
+// Copyright (C) 2010 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-
-// NOTE: This makes use of the fact that we know how moveable
-// is implemented on deque (via swap). If the implementation changed
-// this test may begin to fail.
-
-#include <deque>
-#include <utility>
+#include <forward_list>
 #include <testsuite_hooks.h>
 
-int main()
+void test01()
 {
   bool test __attribute__((unused)) = true;
 
-  std::deque<int> a,b;
-  a.push_back(1);
-  b = std::move(a);
-  VERIFY( b.size() == 1 && b[0] == 1 && a.size() == 0 );
+  std::forward_list<int> fl0(10, 1);
+  const std::forward_list<int> fl1(fl0);
+  fl0 = std::move(fl0);
+  // VERIFY( fl0.size() == 10 );
+  VERIFY( fl0 == fl1 );
+}
 
-  std::deque<int> c(std::move(b));
-  VERIFY( c.size() == 1 && c[0] == 1 );
-  VERIFY( b.size() == 0 );
+int main()
+{
+  test01();
   return 0;
 }
diff --git a/libstdc++-v3/testsuite/23_containers/list/cons/self_move_assign.cc b/libstdc++-v3/testsuite/23_containers/list/cons/self_move_assign.cc
new file mode 100644 (file)
index 0000000..d406ecd
--- /dev/null
@@ -0,0 +1,40 @@
+// { dg-options "-std=gnu++0x" }
+
+// 2010-01-08  Paolo Carlini  <paolo.carlini@oracle.com>
+
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <list>
+#include <testsuite_hooks.h>
+
+void test01()
+{
+  bool test __attribute__((unused)) = true;
+
+  std::list<int> l0(10, 1);
+  const std::list<int> l1(l0);
+  l0 = std::move(l0);
+  VERIFY( l0.size() == 10 );
+  VERIFY( l0 == l1 );
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
index a9ef74472bf2e058ca262f1e280ad2f849fdfd2e..24ee3fac6e7eda9a0896df5a395c4a0a41363b5f 100644 (file)
@@ -1,6 +1,6 @@
 // 2007-04-27  Paolo Carlini  <pcarlini@suse.de>
 
-// Copyright (C) 2007, 2008, 2009 Free Software Foundation
+// Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
@@ -18,7 +18,7 @@
 // <http://www.gnu.org/licenses/>.
 
 // { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1409 }
+// { dg-error "no matching" "" { target *-*-* } 1412 }
 // { dg-excess-errors "" }
 
 #include <list>
index a3e29627f8dc3b16a278951141560c486bc4d88b..3e0f7d936cb4b16bbc4838c36bff587d1237c6c7 100644 (file)
@@ -18,7 +18,7 @@
 // <http://www.gnu.org/licenses/>.
 
 // { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1378 }
+// { dg-error "no matching" "" { target *-*-* } 1381 }
 // { dg-excess-errors "" }
 
 #include <list>
index f90ed940727db5b1c75d4986a82e5a4802ddbaf7..ec29e3b0f089fed078cac6d6583d2472b3a5c62c 100644 (file)
@@ -1,6 +1,6 @@
 // 2007-04-27  Paolo Carlini  <pcarlini@suse.de>
 
-// Copyright (C) 2007, 2008, 2009 Free Software Foundation
+// Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
@@ -18,7 +18,7 @@
 // <http://www.gnu.org/licenses/>.
 
 // { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1378 }
+// { dg-error "no matching" "" { target *-*-* } 1381 }
 // { dg-excess-errors "" }
 
 #include <list>
index 24bcee0c7fd324fff1001a90d37605dd4b4a9f62..0d4a001c117da723852dd902143d42045995a506 100644 (file)
@@ -1,6 +1,6 @@
 // 2007-04-27  Paolo Carlini  <pcarlini@suse.de>
 
-// Copyright (C) 2007, 2008, 2009 Free Software Foundation
+// Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
@@ -18,7 +18,7 @@
 // <http://www.gnu.org/licenses/>.
 
 // { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1378 }
+// { dg-error "no matching" "" { target *-*-* } 1381 }
 // { dg-excess-errors "" }
 
 #include <list>
diff --git a/libstdc++-v3/testsuite/23_containers/map/cons/self_move_assign.cc b/libstdc++-v3/testsuite/23_containers/map/cons/self_move_assign.cc
new file mode 100644 (file)
index 0000000..dbf153c
--- /dev/null
@@ -0,0 +1,44 @@
+// { dg-options "-std=gnu++0x" }
+
+// 2010-01-08  Paolo Carlini  <paolo.carlini@oracle.com>
+
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <map>
+#include <testsuite_hooks.h>
+
+void test01()
+{
+  bool test __attribute__((unused)) = true;
+
+  typedef std::map<int, int>       map_type;
+  typedef map_type::value_type   value_type;
+
+  map_type m0{ value_type(1, 1), value_type(2, 2), value_type(3, 3) };
+
+  const map_type m1(m0);
+  m0 = std::move(m0);
+  VERIFY( m0.size() == 3 );
+  VERIFY( m0 == m1 );
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/multimap/cons/self_move_assign.cc b/libstdc++-v3/testsuite/23_containers/multimap/cons/self_move_assign.cc
new file mode 100644 (file)
index 0000000..0d2f9e7
--- /dev/null
@@ -0,0 +1,44 @@
+// { dg-options "-std=gnu++0x" }
+
+// 2010-01-08  Paolo Carlini  <paolo.carlini@oracle.com>
+
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <map>
+#include <testsuite_hooks.h>
+
+void test01()
+{
+  bool test __attribute__((unused)) = true;
+
+  typedef std::multimap<int, int>    mmap_type;
+  typedef mmap_type::value_type     value_type;
+
+  mmap_type mm0{ value_type(1, 1), value_type(2, 2), value_type(3, 3) };
+
+  const mmap_type mm1(mm0);
+  mm0 = std::move(mm0);
+  VERIFY( mm0.size() == 3 );
+  VERIFY( mm0 == mm1 );
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/multiset/cons/self_move_assign.cc b/libstdc++-v3/testsuite/23_containers/multiset/cons/self_move_assign.cc
new file mode 100644 (file)
index 0000000..f1e4e1d
--- /dev/null
@@ -0,0 +1,43 @@
+// { dg-options "-std=gnu++0x" }
+
+// 2010-01-08  Paolo Carlini  <paolo.carlini@oracle.com>
+
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <set>
+#include <testsuite_hooks.h>
+
+void test01()
+{
+  bool test __attribute__((unused)) = true;
+
+  typedef std::multiset<int>  mset_type;
+
+  mset_type ms0{ 1, 2, 3 };
+
+  const mset_type ms1(ms0);
+  ms0 = std::move(ms0);
+  VERIFY( ms0.size() == 3 );
+  VERIFY( ms0 == ms1 );
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/set/cons/self_move_assign.cc b/libstdc++-v3/testsuite/23_containers/set/cons/self_move_assign.cc
new file mode 100644 (file)
index 0000000..d8f676b
--- /dev/null
@@ -0,0 +1,43 @@
+// { dg-options "-std=gnu++0x" }
+
+// 2010-01-08  Paolo Carlini  <paolo.carlini@oracle.com>
+
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <set>
+#include <testsuite_hooks.h>
+
+void test01()
+{
+  bool test __attribute__((unused)) = true;
+
+  typedef std::set<int>  set_type;
+
+  set_type s0{ 1, 2, 3 };
+
+  const set_type s1(s0);
+  s0 = std::move(s0);
+  VERIFY( s0.size() == 3 );
+  VERIFY( s0 == s1 );
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/cons/self_move_assign.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/cons/self_move_assign.cc
new file mode 100644 (file)
index 0000000..a31a1ee
--- /dev/null
@@ -0,0 +1,44 @@
+// { dg-options "-std=gnu++0x" }
+
+// 2010-01-08  Paolo Carlini  <paolo.carlini@oracle.com>
+
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <unordered_map>
+#include <testsuite_hooks.h>
+
+void test01()
+{
+  bool test __attribute__((unused)) = true;
+
+  typedef std::unordered_map<int, int>  umap_type;
+  typedef umap_type::value_type        value_type;
+
+  umap_type um0{ value_type(1, 1), value_type(2, 2), value_type(3, 3) };
+
+  const umap_type um1(um0);
+  um0 = std::move(um0);
+  VERIFY( um0.size() == 3 );
+  // VERIFY( um0 == um1 );
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multimap/cons/self_move_assign.cc b/libstdc++-v3/testsuite/23_containers/unordered_multimap/cons/self_move_assign.cc
new file mode 100644 (file)
index 0000000..c44e8d8
--- /dev/null
@@ -0,0 +1,44 @@
+// { dg-options "-std=gnu++0x" }
+
+// 2010-01-08  Paolo Carlini  <paolo.carlini@oracle.com>
+
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <unordered_map>
+#include <testsuite_hooks.h>
+
+void test01()
+{
+  bool test __attribute__((unused)) = true;
+
+  typedef std::unordered_multimap<int, int>  ummap_type;
+  typedef ummap_type::value_type             value_type;
+
+  ummap_type umm0{ value_type(1, 1), value_type(2, 2), value_type(3, 3) };
+
+  const ummap_type umm1(umm0);
+  umm0 = std::move(umm0);
+  VERIFY( umm0.size() == 3 );
+  // VERIFY( umm0 == umm1 );
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multiset/cons/self_move_assign.cc b/libstdc++-v3/testsuite/23_containers/unordered_multiset/cons/self_move_assign.cc
new file mode 100644 (file)
index 0000000..7929f6b
--- /dev/null
@@ -0,0 +1,43 @@
+// { dg-options "-std=gnu++0x" }
+
+// 2010-01-08  Paolo Carlini  <paolo.carlini@oracle.com>
+
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <unordered_set>
+#include <testsuite_hooks.h>
+
+void test01()
+{
+  bool test __attribute__((unused)) = true;
+
+  typedef std::unordered_multiset<int>  umset_type;
+
+  umset_type ums0{ 1, 2, 3 };
+
+  const umset_type ums1(ums0);
+  ums0 = std::move(ums0);
+  VERIFY( ums0.size() == 3 );
+  // VERIFY( ums0 == ums1 );
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_set/cons/self_move_assign.cc b/libstdc++-v3/testsuite/23_containers/unordered_set/cons/self_move_assign.cc
new file mode 100644 (file)
index 0000000..7ce6db0
--- /dev/null
@@ -0,0 +1,43 @@
+// { dg-options "-std=gnu++0x" }
+
+// 2010-01-08  Paolo Carlini  <paolo.carlini@oracle.com>
+
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <unordered_set>
+#include <testsuite_hooks.h>
+
+void test01()
+{
+  bool test __attribute__((unused)) = true;
+
+  typedef std::unordered_set<int>   uset_type;
+
+  uset_type us0{ 1, 2, 3 };
+
+  const uset_type us1(us0);
+  us0 = std::move(us0);
+  VERIFY( us0.size() == 3 );
+  // VERIFY( us0 == us1 );
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
index ab04ccf0c152f852ab76f68f98dade2c39d2c245..8807ad9b4a41c4d202aa61707741932ad0f001c1 100644 (file)
@@ -1,4 +1,3 @@
-// { dg-do compile } 
 // { dg-options "-std=gnu++0x" }
 
 // Copyright (C) 2005, 2007, 2009 Free Software Foundation, Inc.
 // <http://www.gnu.org/licenses/>.
 
 
+// NOTE: This makes use of the fact that we know how moveable
+// is implemented on vector (via swap). If the implementation changed
+// this test may begin to fail.
+
 #include <vector>
-#include <iterator>
-#include <testsuite_iterators.h>
-#include <testsuite_rvalref.h>
-
-using namespace __gnu_test;
-typedef std::vector<rvalstruct> test_type;
-
-// Empty constructor doesn't require a copy constructor
-void
-test01()
-{ test_type d; }
-
-// Constructing from a range that returns rvalue references doesn't
-// require a copy constructor.
-void
-test02(rvalstruct* begin, rvalstruct* end)
-{ 
-  test_type d(std::make_move_iterator(begin), std::make_move_iterator(end));
+#include <utility>
+#include <testsuite_hooks.h>
+
+void test01()
+{
+  bool test __attribute__((unused)) = true;
+
+  std::vector<int> a,b;
+  a.push_back(1);
+  b = std::move(a);
+  VERIFY( b.size() == 1 && b[0] == 1 && a.size() == 0 );
+
+  std::vector<int> c(std::move(b));
+  VERIFY( c.size() == 1 && c[0] == 1 );
+  VERIFY( b.size() == 0 );
 }
 
-// Constructing from a input iterator range that returns rvalue
-// references doesn't require a copy constructor either.
-void
-test03(input_iterator_wrapper<rvalstruct> begin,
-       input_iterator_wrapper<rvalstruct> end)
-{ 
-  test_type d(std::make_move_iterator(begin), std::make_move_iterator(end));
+void test02()
+{
+  bool test __attribute__((unused)) = true;
+  
+  std::vector<bool> a,b;
+  a.push_back(1);
+  b = std::move(a);
+  VERIFY( b.size() == 1 && b[0] == 1 && a.size() == 0 );
+
+  std::vector<bool> c(std::move(b));
+  VERIFY( c.size() == 1 && c[0] == 1 );
+  VERIFY( b.size() == 0 );
 }
 
-// Neither does destroying one.
-void
-test04(test_type* d)
-{ delete d; }
+int main(void)
+{
+  test01();
+  test02();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/vector/cons/moveable2.cc b/libstdc++-v3/testsuite/23_containers/vector/cons/moveable2.cc
new file mode 100644 (file)
index 0000000..ab04ccf
--- /dev/null
@@ -0,0 +1,55 @@
+// { dg-do compile } 
+// { dg-options "-std=gnu++0x" }
+
+// Copyright (C) 2005, 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+
+#include <vector>
+#include <iterator>
+#include <testsuite_iterators.h>
+#include <testsuite_rvalref.h>
+
+using namespace __gnu_test;
+typedef std::vector<rvalstruct> test_type;
+
+// Empty constructor doesn't require a copy constructor
+void
+test01()
+{ test_type d; }
+
+// Constructing from a range that returns rvalue references doesn't
+// require a copy constructor.
+void
+test02(rvalstruct* begin, rvalstruct* end)
+{ 
+  test_type d(std::make_move_iterator(begin), std::make_move_iterator(end));
+}
+
+// Constructing from a input iterator range that returns rvalue
+// references doesn't require a copy constructor either.
+void
+test03(input_iterator_wrapper<rvalstruct> begin,
+       input_iterator_wrapper<rvalstruct> end)
+{ 
+  test_type d(std::make_move_iterator(begin), std::make_move_iterator(end));
+}
+
+// Neither does destroying one.
+void
+test04(test_type* d)
+{ delete d; }
similarity index 52%
rename from libstdc++-v3/testsuite/23_containers/vector/moveable.cc
rename to libstdc++-v3/testsuite/23_containers/vector/cons/self_move_assign.cc
index 8807ad9b4a41c4d202aa61707741932ad0f001c1..d7c5d285465e160f2eb2d0b2079927a9230e17a8 100644 (file)
@@ -1,6 +1,8 @@
 // { dg-options "-std=gnu++0x" }
 
-// Copyright (C) 2005, 2007, 2009 Free Software Foundation, Inc.
+// 2010-01-08  Paolo Carlini  <paolo.carlini@oracle.com>
+
+// Copyright (C) 2010 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-
-// NOTE: This makes use of the fact that we know how moveable
-// is implemented on vector (via swap). If the implementation changed
-// this test may begin to fail.
-
 #include <vector>
-#include <utility>
 #include <testsuite_hooks.h>
 
 void test01()
 {
   bool test __attribute__((unused)) = true;
 
-  std::vector<int> a,b;
-  a.push_back(1);
-  b = std::move(a);
-  VERIFY( b.size() == 1 && b[0] == 1 && a.size() == 0 );
-
-  std::vector<int> c(std::move(b));
-  VERIFY( c.size() == 1 && c[0] == 1 );
-  VERIFY( b.size() == 0 );
-}
-
-void test02()
-{
-  bool test __attribute__((unused)) = true;
-  
-  std::vector<bool> a,b;
-  a.push_back(1);
-  b = std::move(a);
-  VERIFY( b.size() == 1 && b[0] == 1 && a.size() == 0 );
-
-  std::vector<bool> c(std::move(b));
-  VERIFY( c.size() == 1 && c[0] == 1 );
-  VERIFY( b.size() == 0 );
+  std::vector<int> v0(10, 1);
+  const std::vector<int> v1(v0);
+  v0 = std::move(v0);
+  VERIFY( v0.size() == 10 );
+  VERIFY( v0 == v1 );
 }
 
-int main(void)
+int main()
 {
   test01();
-  test02();
   return 0;
 }
index 8bab7374da96705cdfbf754cbec466fce827ada2..bb9a56e924f342c105e0ca8dbfec5354999fc82b 100644 (file)
@@ -18,7 +18,7 @@
 // <http://www.gnu.org/licenses/>.
 
 // { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1054 }
+// { dg-error "no matching" "" { target *-*-* } 1057 }
 // { dg-excess-errors "" }
 
 #include <vector>
index 0ff3d3b5dbc876a7b47f978583faac9739161553..02ae1c4c7279ec5cd3ae7a566fd57fb04d60e78f 100644 (file)
@@ -18,7 +18,7 @@
 // <http://www.gnu.org/licenses/>.
 
 // { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 994 }
+// { dg-error "no matching" "" { target *-*-* } 997 }
 // { dg-excess-errors "" }
 
 #include <vector>
index 3f51e0db49a4400b00d75d9d43b6ece0c9ee2244..f9c3f4a2205a5806838688ff87bbda2b91ab931a 100644 (file)
@@ -18,7 +18,7 @@
 // <http://www.gnu.org/licenses/>.
 
 // { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 994 }
+// { dg-error "no matching" "" { target *-*-* } 997 }
 // { dg-excess-errors "" }
 
 #include <vector>
index f710a584a6c747e8bbe9ab895a75d87052505076..82acbbc97b97080df402caab713896504f48f19b 100644 (file)
@@ -18,7 +18,7 @@
 // <http://www.gnu.org/licenses/>.
 
 // { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1095 }
+// { dg-error "no matching" "" { target *-*-* } 1098 }
 // { dg-excess-errors "" }
 
 #include <vector>
diff --git a/libstdc++-v3/testsuite/ext/vstring/cons/self_move_assign.cc b/libstdc++-v3/testsuite/ext/vstring/cons/self_move_assign.cc
new file mode 100644 (file)
index 0000000..caa8e4f
--- /dev/null
@@ -0,0 +1,41 @@
+// { dg-options "-std=gnu++0x" }
+// { dg-require-string-conversions "" }
+
+// 2010-01-08  Paolo Carlini  <paolo.carlini@oracle.com>
+
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <ext/vstring.h>
+#include <testsuite_hooks.h>
+
+void test01()
+{
+  bool test __attribute__((unused)) = true;
+
+  __gnu_cxx::__vstring vs0(10, 'a');
+  const __gnu_cxx::__vstring vs1(vs0);
+  vs0 = std::move(vs0);
+  VERIFY( vs0.size() == 10 );
+  VERIFY( vs0 == vs1 );
+}
+
+int main()
+{
+  test01();
+  return 0;
+}