public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [v3] Fix move assignment operators vs self assignment
@ 2010-01-09  2:53 Paolo Carlini
  2010-01-09 10:13 ` Bo Persson
  0 siblings, 1 reply; 4+ messages in thread
From: Paolo Carlini @ 2010-01-09  2:53 UTC (permalink / raw)
  To: gcc-patches; +Cc: libstdc++

[-- Attachment #1: Type: text/plain, Size: 104 bytes --]

Hi,

a serious oversight, sorry. Tested x86_64-linux, committed to mainline.

Paolo.

/////////////////

[-- Attachment #2: CL_self_move_assign --]
[-- Type: text/plain, Size: 5149 bytes --]

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.



[-- Attachment #3: patch_self_move_assign --]
[-- Type: text/plain, Size: 68044 bytes --]

Index: include/debug/set.h
===================================================================
--- include/debug/set.h	(revision 155741)
+++ include/debug/set.h	(working copy)
@@ -113,9 +113,12 @@
       set&
       operator=(set&& __x)
       {
-        // NB: DR 675.
-	clear();
-	swap(__x);
+	if (this != &__x)
+	  {
+	    // NB: DR 675.
+	    clear();
+	    swap(__x);
+	  }
 	return *this;
       }
 
Index: include/debug/unordered_map
===================================================================
--- include/debug/unordered_map	(revision 155741)
+++ include/debug/unordered_map	(working copy)
@@ -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 @@
       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 @@
       unordered_multimap&
       operator=(unordered_multimap&& __x)
       {
-        // NB: DR 675.
-	clear();
-	swap(__x);
+	if (this != &__x)
+	  {
+	    // NB: DR 675.
+	    clear();
+	    swap(__x);
+	  }
 	return *this;
       }
 
Index: include/debug/multiset.h
===================================================================
--- include/debug/multiset.h	(revision 155741)
+++ include/debug/multiset.h	(working copy)
@@ -113,9 +113,12 @@
       multiset&
       operator=(multiset&& __x)
       {
-        // NB: DR 675.
-	clear();
-	swap(__x);
+	if (this != &__x)
+	  {
+	    // NB: DR 675.
+	    clear();
+	    swap(__x);
+	  }
 	return *this;
       }
 
Index: include/debug/vector
===================================================================
--- include/debug/vector	(revision 155741)
+++ include/debug/vector	(working copy)
@@ -124,9 +124,12 @@
       vector&
       operator=(vector&& __x)
       {
-        // NB: DR 675.
-	clear();
-	swap(__x);
+	if (this != &__x)
+	  {
+	    // NB: DR 675.
+	    clear();
+	    swap(__x);
+	  }
 	return *this;
       }
 
Index: include/debug/unordered_set
===================================================================
--- include/debug/unordered_set	(revision 155741)
+++ include/debug/unordered_set	(working copy)
@@ -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 @@
       unordered_set&
       operator=(unordered_set&& __x)
       {
-        // NB: DR 675.
-	clear();
-	swap(__x);
+	if (this != &__x)
+	  {
+	    // NB: DR 675.
+	    clear();
+	    swap(__x);
+	  }
 	return *this;
       }
 
Index: include/debug/deque
===================================================================
--- include/debug/deque	(revision 155741)
+++ include/debug/deque	(working copy)
@@ -110,9 +110,12 @@
       deque&
       operator=(deque&& __x)
       {
-        // NB: DR 675.
-	clear();
-	swap(__x);	  
+	if (this != &__x)
+	  {
+	    // NB: DR 675.
+	    clear();
+	    swap(__x);
+	  }	  
 	return *this;
       }
 
Index: include/debug/map.h
===================================================================
--- include/debug/map.h	(revision 155741)
+++ include/debug/map.h	(working copy)
@@ -115,9 +115,12 @@
       map&
       operator=(map&& __x)
       {
-        // NB: DR 675.
-	clear();
-	swap(__x);
+	if (this != &__x)
+	  {
+	    // NB: DR 675.
+	    clear();
+	    swap(__x);
+	  }
 	return *this;
       }
 
Index: include/debug/list
===================================================================
--- include/debug/list	(revision 155741)
+++ include/debug/list	(working copy)
@@ -112,9 +112,12 @@
       list&
       operator=(list&& __x)
       {
-        // NB: DR 675.
-	clear();
-	swap(__x);
+	if (this != &__x)
+	  {
+	    // NB: DR 675.
+	    clear();
+	    swap(__x);
+	  }
 	return *this;
       }
 
Index: include/debug/multimap.h
===================================================================
--- include/debug/multimap.h	(revision 155741)
+++ include/debug/multimap.h	(working copy)
@@ -116,9 +116,12 @@
       multimap&
       operator=(multimap&& __x)
       {
-        // NB: DR 675.
-	clear();
-	swap(__x);
+	if (this != &__x)
+	  {
+	    // NB: DR 675.
+	    clear();
+	    swap(__x);
+	  }
 	return *this;
       }
 
Index: include/tr1_impl/unordered_map
===================================================================
--- include/tr1_impl/unordered_map	(revision 155741)
+++ include/tr1_impl/unordered_map	(working copy)
@@ -229,9 +229,12 @@
       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 @@
       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: include/tr1_impl/unordered_set
===================================================================
--- include/tr1_impl/unordered_set	(revision 155741)
+++ include/tr1_impl/unordered_set	(working copy)
@@ -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 @@
       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 @@
       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: include/profile/set.h
===================================================================
--- include/profile/set.h	(revision 155741)
+++ include/profile/set.h	(working copy)
@@ -104,9 +104,12 @@
       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: include/profile/unordered_map
===================================================================
--- include/profile/unordered_map	(revision 155741)
+++ include/profile/unordered_map	(working copy)
@@ -130,9 +130,12 @@
       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 @@
       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: include/profile/multiset.h
===================================================================
--- include/profile/multiset.h	(revision 155741)
+++ include/profile/multiset.h	(working copy)
@@ -104,9 +104,12 @@
       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: include/profile/unordered_set
===================================================================
--- include/profile/unordered_set	(revision 155741)
+++ include/profile/unordered_set	(working copy)
@@ -129,9 +129,12 @@
       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 @@
       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: include/profile/vector
===================================================================
--- include/profile/vector	(revision 155741)
+++ include/profile/vector	(working copy)
@@ -140,9 +140,12 @@
       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: include/profile/deque
===================================================================
--- include/profile/deque	(revision 155741)
+++ include/profile/deque	(working copy)
@@ -102,9 +102,12 @@
       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: include/profile/map.h
===================================================================
--- include/profile/map.h	(revision 155741)
+++ include/profile/map.h	(working copy)
@@ -121,9 +121,12 @@
       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: include/profile/list
===================================================================
--- include/profile/list	(revision 155741)
+++ include/profile/list	(working copy)
@@ -102,9 +102,12 @@
       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: include/profile/multimap.h
===================================================================
--- include/profile/multimap.h	(revision 155741)
+++ include/profile/multimap.h	(working copy)
@@ -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 @@
       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: include/ext/vstring.h
===================================================================
--- include/ext/vstring.h	(revision 155741)
+++ include/ext/vstring.h	(working copy)
@@ -261,7 +261,10 @@
       operator=(__versa_string&& __str)
       {
 	if (this != &__str)
-	  this->swap(__str);
+	  {
+	    this->clear();
+	    this->swap(__str);
+	  }
 	return *this;
       }
 
Index: include/bits/stl_list.h
===================================================================
--- include/bits/stl_list.h	(revision 155748)
+++ include/bits/stl_list.h	(working copy)
@@ -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 @@
       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: include/bits/stl_map.h
===================================================================
--- include/bits/stl_map.h	(revision 155748)
+++ include/bits/stl_map.h	(working copy)
@@ -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 @@
       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: include/bits/stl_set.h
===================================================================
--- include/bits/stl_set.h	(revision 155748)
+++ include/bits/stl_set.h	(working copy)
@@ -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 @@
       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: include/bits/stl_multimap.h
===================================================================
--- include/bits/stl_multimap.h	(revision 155748)
+++ include/bits/stl_multimap.h	(working copy)
@@ -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 @@
       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: include/bits/stl_vector.h
===================================================================
--- include/bits/stl_vector.h	(revision 155748)
+++ include/bits/stl_vector.h	(working copy)
@@ -335,9 +335,12 @@
       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: include/bits/stl_deque.h
===================================================================
--- include/bits/stl_deque.h	(revision 155748)
+++ include/bits/stl_deque.h	(working copy)
@@ -884,9 +884,12 @@
       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: include/bits/stl_multiset.h
===================================================================
--- include/bits/stl_multiset.h	(revision 155748)
+++ include/bits/stl_multiset.h	(working copy)
@@ -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 @@
       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: testsuite/ext/vstring/cons/self_move_assign.cc
===================================================================
--- testsuite/ext/vstring/cons/self_move_assign.cc	(revision 0)
+++ testsuite/ext/vstring/cons/self_move_assign.cc	(revision 0)
@@ -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;
+}
Index: testsuite/ext/vstring/moveable.cc
===================================================================
--- testsuite/ext/vstring/moveable.cc	(revision 155741)
+++ testsuite/ext/vstring/moveable.cc	(working copy)
@@ -1,63 +0,0 @@
-// { dg-options "-std=gnu++0x" }
-// { dg-require-string-conversions "" }
-
-// Copyright (C) 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/>.
-
-
-// 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 <ext/vstring.h>
-#include <utility>
-#include <testsuite_hooks.h>
-
-void test01()
-{
-  bool test __attribute__((unused)) = true;
-
-  __gnu_cxx::__sso_string a,b;
-  a.push_back('1');
-  b = std::move(a);
-  VERIFY( b.size() == 1 && b[0] == '1' && a.size() == 0 );
-
-  __gnu_cxx::__sso_string c(std::move(b));
-  VERIFY( c.size() == 1 && c[0] == '1' );
-  VERIFY( b.size() == 0 );
-}
-
-void test02()
-{
-  bool test __attribute__((unused)) = true;
-
-  __gnu_cxx::__rc_string a,b;
-  a.push_back('1');
-  b = std::move(a);
-  VERIFY( b.size() == 1 && b[0] == '1' && a.size() == 0 );
-
-  __gnu_cxx::__rc_string c(std::move(b));
-  VERIFY( c.size() == 1 && c[0] == '1' );
-  VERIFY( b.size() == 0 );
-}
-
-int main()
-{
-  test01();
-  test02();
-  return 0;
-}
Index: testsuite/23_containers/unordered_map/cons/self_move_assign.cc
===================================================================
--- testsuite/23_containers/unordered_map/cons/self_move_assign.cc	(revision 0)
+++ testsuite/23_containers/unordered_map/cons/self_move_assign.cc	(revision 0)
@@ -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;
+}
Index: testsuite/23_containers/unordered_map/moveable.cc
===================================================================
--- testsuite/23_containers/unordered_map/moveable.cc	(revision 155741)
+++ testsuite/23_containers/unordered_map/moveable.cc	(working copy)
@@ -1,43 +0,0 @@
-// { dg-options "-std=gnu++0x" }
-
-// Copyright (C) 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/>.
-
-
-// NOTE: This makes use of the fact that we know how moveable
-// is implemented on map (via swap). If the implementation changed
-// this test may begin to fail.
-
-#include <unordered_map>
-#include <utility>
-#include <testsuite_hooks.h>
-
-int main()
-{
-  bool test __attribute__((unused)) = true;
-
-  std::unordered_map<int, int> a,b;
-  a[2]=0;
-  b[1]=0;
-  b = std::move(a);
-  VERIFY( b.find(2) != b.end() && a.find(1) == a.end() );
-
-  std::unordered_map<int, int> c(std::move(b));
-  VERIFY( c.find(2) != c.end() );
-  VERIFY( b.find(2) == b.end() );
-  return 0;
-}
Index: testsuite/23_containers/multimap/cons/self_move_assign.cc
===================================================================
--- testsuite/23_containers/multimap/cons/self_move_assign.cc	(revision 0)
+++ testsuite/23_containers/multimap/cons/self_move_assign.cc	(revision 0)
@@ -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;
+}
Index: testsuite/23_containers/multimap/moveable.cc
===================================================================
--- testsuite/23_containers/multimap/moveable.cc	(revision 155741)
+++ testsuite/23_containers/multimap/moveable.cc	(working copy)
@@ -1,43 +0,0 @@
-// { 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/>.
-
-
-// NOTE: This makes use of the fact that we know how moveable
-// is implemented on multimap (via swap). If the implementation changed
-// this test may begin to fail.
-
-#include <map>
-#include <utility>
-#include <testsuite_hooks.h>
-
-int main()
-{
-  bool test __attribute__((unused)) = true;
-
-  std::multimap<int, int> a,b;
-  a.insert(std::make_pair(2,0));
-  b.insert(std::make_pair(1,0));
-  b = std::move(a);
-  VERIFY(b.find(2) != b.end() && a.find(1) == a.end());
-
-  std::multimap<int, int> c(std::move(b));
-  VERIFY( c.find(2) != c.end());
-  VERIFY( b.find(2) == b.end());
-  return 0;
-}
Index: testsuite/23_containers/set/cons/self_move_assign.cc
===================================================================
--- testsuite/23_containers/set/cons/self_move_assign.cc	(revision 0)
+++ testsuite/23_containers/set/cons/self_move_assign.cc	(revision 0)
@@ -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;
+}
Index: testsuite/23_containers/set/moveable.cc
===================================================================
--- testsuite/23_containers/set/moveable.cc	(revision 155741)
+++ testsuite/23_containers/set/moveable.cc	(working copy)
@@ -1,43 +0,0 @@
-// { 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/>.
-
-
-// NOTE: This makes use of the fact that we know how moveable
-// is implemented on set (via swap). If the implementation changed
-// this test may begin to fail.
-
-#include <set>
-#include <utility>
-#include <testsuite_hooks.h>
-
-int main()
-{
-  bool test __attribute__((unused)) = true;
-
-  std::set<int> a,b;
-  a.insert(2);
-  b.insert(1);
-  b = std::move(a);
-  VERIFY(b.find(2) != b.end() && a.find(1) == a.end());
-
-  std::set<int> c(std::move(b));
-  VERIFY( c.find(2) != c.end());
-  VERIFY( b.find(2) == b.end());
-  return 0;
-}
Index: testsuite/23_containers/unordered_multimap/cons/self_move_assign.cc
===================================================================
--- testsuite/23_containers/unordered_multimap/cons/self_move_assign.cc	(revision 0)
+++ testsuite/23_containers/unordered_multimap/cons/self_move_assign.cc	(revision 0)
@@ -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;
+}
Index: testsuite/23_containers/unordered_multimap/moveable.cc
===================================================================
--- testsuite/23_containers/unordered_multimap/moveable.cc	(revision 155741)
+++ testsuite/23_containers/unordered_multimap/moveable.cc	(working copy)
@@ -1,43 +0,0 @@
-// { dg-options "-std=gnu++0x" }
-
-// Copyright (C) 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/>.
-
-
-// NOTE: This makes use of the fact that we know how moveable
-// is implemented on multimap (via swap). If the implementation changed
-// this test may begin to fail.
-
-#include <unordered_map>
-#include <utility>
-#include <testsuite_hooks.h>
-
-int main()
-{
-  bool test __attribute__((unused)) = true;
-
-  std::unordered_multimap<int, int> a,b;
-  a.insert(std::make_pair(2,0));
-  b.insert(std::make_pair(1,0));
-  b = std::move(a);
-  VERIFY( b.find(2) != b.end() && a.find(1) == a.end() );
-
-  std::unordered_multimap<int, int> c(std::move(b));
-  VERIFY( c.find(2) != c.end() );
-  VERIFY( b.find(2) == b.end() );
-  return 0;
-}
Index: testsuite/23_containers/forward_list/cons/self_move_assign.cc
===================================================================
--- testsuite/23_containers/forward_list/cons/self_move_assign.cc	(revision 0)
+++ testsuite/23_containers/forward_list/cons/self_move_assign.cc	(revision 0)
@@ -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 <forward_list>
+#include <testsuite_hooks.h>
+
+void test01()
+{
+  bool test __attribute__((unused)) = true;
+
+  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 );
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
Index: testsuite/23_containers/forward_list/moveable.cc
===================================================================
--- testsuite/23_containers/forward_list/moveable.cc	(revision 155741)
+++ testsuite/23_containers/forward_list/moveable.cc	(working copy)
@@ -1,47 +0,0 @@
-// { dg-options "-std=gnu++0x" }
-
-// Copyright (C) 2008, 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/>.
-
-
-// NOTE: This makes use of the fact that we know how moveable
-// is implemented on list (via swap). If the implementation changed
-// this test may begin to fail.
-
-#include <forward_list>
-#include <utility>
-#include <testsuite_hooks.h>
-
-bool test __attribute__((unused)) = true;
-
-int main()
-{
-  std::forward_list<int> a, b;
-  a.push_front(1);
-
-  b = std::move(a);
-  VERIFY(b.empty() == false);
-  VERIFY(*b.begin() == 1);
-  VERIFY(a.empty() == true);
-
-  std::forward_list<int> c(std::move(b));
-  VERIFY(c.empty() == false);
-  (*c.begin() == 1 );
-  VERIFY( b.empty() == true );
-
-  return 0;
-}
Index: testsuite/23_containers/unordered_set/cons/self_move_assign.cc
===================================================================
--- testsuite/23_containers/unordered_set/cons/self_move_assign.cc	(revision 0)
+++ testsuite/23_containers/unordered_set/cons/self_move_assign.cc	(revision 0)
@@ -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: testsuite/23_containers/unordered_set/moveable.cc
===================================================================
--- testsuite/23_containers/unordered_set/moveable.cc	(revision 155741)
+++ testsuite/23_containers/unordered_set/moveable.cc	(working copy)
@@ -1,43 +0,0 @@
-// { dg-options "-std=gnu++0x" }
-
-// Copyright (C) 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/>.
-
-
-// NOTE: This makes use of the fact that we know how moveable
-// is implemented on set (via swap). If the implementation changed
-// this test may begin to fail.
-
-#include <unordered_set>
-#include <utility>
-#include <testsuite_hooks.h>
-
-int main()
-{
-  bool test __attribute__((unused)) = true;
-
-  std::unordered_set<int> a,b;
-  a.insert(2);
-  b.insert(1);
-  b = std::move(a);
-  VERIFY( b.find(2) != b.end() && a.find(1) == a.end() );
-
-  std::unordered_set<int> c(std::move(b));
-  VERIFY( c.find(2) != c.end() );
-  VERIFY( b.find(2) == b.end() );
-  return 0;
-}
Index: testsuite/23_containers/vector/requirements/dr438/assign_neg.cc
===================================================================
--- testsuite/23_containers/vector/requirements/dr438/assign_neg.cc	(revision 155741)
+++ testsuite/23_containers/vector/requirements/dr438/assign_neg.cc	(working copy)
@@ -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: testsuite/23_containers/vector/requirements/dr438/insert_neg.cc
===================================================================
--- testsuite/23_containers/vector/requirements/dr438/insert_neg.cc	(revision 155741)
+++ testsuite/23_containers/vector/requirements/dr438/insert_neg.cc	(working copy)
@@ -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>
Index: testsuite/23_containers/vector/requirements/dr438/constructor_1_neg.cc
===================================================================
--- testsuite/23_containers/vector/requirements/dr438/constructor_1_neg.cc	(revision 155741)
+++ testsuite/23_containers/vector/requirements/dr438/constructor_1_neg.cc	(working copy)
@@ -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: testsuite/23_containers/vector/requirements/dr438/constructor_2_neg.cc
===================================================================
--- testsuite/23_containers/vector/requirements/dr438/constructor_2_neg.cc	(revision 155741)
+++ testsuite/23_containers/vector/requirements/dr438/constructor_2_neg.cc	(working copy)
@@ -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: testsuite/23_containers/vector/cons/self_move_assign.cc
===================================================================
--- testsuite/23_containers/vector/cons/self_move_assign.cc	(revision 0)
+++ testsuite/23_containers/vector/cons/self_move_assign.cc	(revision 0)
@@ -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 <vector>
+#include <testsuite_hooks.h>
+
+void test01()
+{
+  bool test __attribute__((unused)) = true;
+
+  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()
+{
+  test01();
+  return 0;
+}
Index: testsuite/23_containers/vector/moveable.cc
===================================================================
--- testsuite/23_containers/vector/moveable.cc	(revision 155741)
+++ testsuite/23_containers/vector/moveable.cc	(working copy)
@@ -1,62 +0,0 @@
-// { 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/>.
-
-
-// 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 );
-}
-
-int main(void)
-{
-  test01();
-  test02();
-  return 0;
-}
Index: testsuite/23_containers/deque/cons/self_move_assign.cc
===================================================================
--- testsuite/23_containers/deque/cons/self_move_assign.cc	(revision 0)
+++ testsuite/23_containers/deque/cons/self_move_assign.cc	(revision 0)
@@ -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: testsuite/23_containers/deque/requirements/dr438/assign_neg.cc
===================================================================
--- testsuite/23_containers/deque/requirements/dr438/assign_neg.cc	(revision 155741)
+++ testsuite/23_containers/deque/requirements/dr438/assign_neg.cc	(working copy)
@@ -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: testsuite/23_containers/deque/requirements/dr438/insert_neg.cc
===================================================================
--- testsuite/23_containers/deque/requirements/dr438/insert_neg.cc	(revision 155741)
+++ testsuite/23_containers/deque/requirements/dr438/insert_neg.cc	(working copy)
@@ -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>
Index: testsuite/23_containers/deque/requirements/dr438/constructor_1_neg.cc
===================================================================
--- testsuite/23_containers/deque/requirements/dr438/constructor_1_neg.cc	(revision 155741)
+++ testsuite/23_containers/deque/requirements/dr438/constructor_1_neg.cc	(working copy)
@@ -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: testsuite/23_containers/deque/requirements/dr438/constructor_2_neg.cc
===================================================================
--- testsuite/23_containers/deque/requirements/dr438/constructor_2_neg.cc	(revision 155741)
+++ testsuite/23_containers/deque/requirements/dr438/constructor_2_neg.cc	(working copy)
@@ -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: testsuite/23_containers/deque/moveable.cc
===================================================================
--- testsuite/23_containers/deque/moveable.cc	(revision 155741)
+++ testsuite/23_containers/deque/moveable.cc	(working copy)
@@ -1,42 +0,0 @@
-// { 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/>.
-
-
-// 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 <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;
-}
Index: testsuite/23_containers/multiset/cons/self_move_assign.cc
===================================================================
--- testsuite/23_containers/multiset/cons/self_move_assign.cc	(revision 0)
+++ testsuite/23_containers/multiset/cons/self_move_assign.cc	(revision 0)
@@ -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;
+}
Index: testsuite/23_containers/multiset/moveable.cc
===================================================================
--- testsuite/23_containers/multiset/moveable.cc	(revision 155741)
+++ testsuite/23_containers/multiset/moveable.cc	(working copy)
@@ -1,43 +0,0 @@
-// { 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/>.
-
-
-// NOTE: This makes use of the fact that we know how moveable
-// is implemented on multiset (via swap). If the implementation changed
-// this test may begin to fail.
-
-#include <set>
-#include <utility>
-#include <testsuite_hooks.h>
-
-int main()
-{
-  bool test __attribute__((unused)) = true;
-
-  std::multiset<int> a,b;
-  a.insert(2);
-  b.insert(1);
-  b = std::move(a);
-  VERIFY(b.find(2) != b.end() && a.find(1) == a.end());
-
-  std::multiset<int> c(std::move(b));
-  VERIFY( c.find(2) != c.end());
-  VERIFY( b.find(2) == b.end());
-  return 0;
-}
Index: testsuite/23_containers/list/moveable.h
===================================================================
--- testsuite/23_containers/list/moveable.h	(revision 155741)
+++ testsuite/23_containers/list/moveable.h	(working copy)
@@ -1,41 +0,0 @@
-// Copyright (C) 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/>.
-
-// NOTE: This makes use of the fact that we know how moveable
-// is implemented on list (via swap). If the implementation changed
-// this test may begin to fail.
-
-#include <utility>
-#include <testsuite_hooks.h>
-
-template<typename _Tp>
-  void
-  test_moveable()
-  {
-    bool test __attribute__((unused)) = true;
-
-    typedef _Tp list_type;
-    
-    list_type a,b;
-    a.push_back(1);
-    b = std::move(a);
-    VERIFY( b.size() == 1 && *b.begin() == 1 && a.size() == 0 );
-    
-    list_type c(std::move(b));
-    VERIFY( c.size() == 1 && *c.begin() == 1 );
-    VERIFY( b.size() == 0 );
-  }
Index: testsuite/23_containers/list/requirements/dr438/assign_neg.cc
===================================================================
--- testsuite/23_containers/list/requirements/dr438/assign_neg.cc	(revision 155741)
+++ testsuite/23_containers/list/requirements/dr438/assign_neg.cc	(working copy)
@@ -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: testsuite/23_containers/list/requirements/dr438/insert_neg.cc
===================================================================
--- testsuite/23_containers/list/requirements/dr438/insert_neg.cc	(revision 155741)
+++ testsuite/23_containers/list/requirements/dr438/insert_neg.cc	(working copy)
@@ -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: testsuite/23_containers/list/requirements/dr438/constructor_1_neg.cc
===================================================================
--- testsuite/23_containers/list/requirements/dr438/constructor_1_neg.cc	(revision 155741)
+++ testsuite/23_containers/list/requirements/dr438/constructor_1_neg.cc	(working copy)
@@ -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: testsuite/23_containers/list/requirements/dr438/constructor_2_neg.cc
===================================================================
--- testsuite/23_containers/list/requirements/dr438/constructor_2_neg.cc	(revision 155741)
+++ testsuite/23_containers/list/requirements/dr438/constructor_2_neg.cc	(working copy)
@@ -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: testsuite/23_containers/list/cons/self_move_assign.cc
===================================================================
--- testsuite/23_containers/list/cons/self_move_assign.cc	(revision 0)
+++ testsuite/23_containers/list/cons/self_move_assign.cc	(revision 0)
@@ -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: testsuite/23_containers/list/moveable.cc
===================================================================
--- testsuite/23_containers/list/moveable.cc	(revision 155741)
+++ testsuite/23_containers/list/moveable.cc	(working copy)
@@ -1,27 +0,0 @@
-// { dg-options "-std=gnu++0x" }
-
-// Copyright (C) 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 "moveable.h"
-#include <list>
-
-int main()
-{
-  test_moveable<std::list<int> >();
-  return 0;
-}
Index: testsuite/23_containers/unordered_multiset/cons/self_move_assign.cc
===================================================================
--- testsuite/23_containers/unordered_multiset/cons/self_move_assign.cc	(revision 0)
+++ testsuite/23_containers/unordered_multiset/cons/self_move_assign.cc	(revision 0)
@@ -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;
+}
Index: testsuite/23_containers/unordered_multiset/moveable.cc
===================================================================
--- testsuite/23_containers/unordered_multiset/moveable.cc	(revision 155741)
+++ testsuite/23_containers/unordered_multiset/moveable.cc	(working copy)
@@ -1,43 +0,0 @@
-// { dg-options "-std=gnu++0x" }
-
-// Copyright (C) 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/>.
-
-
-// NOTE: This makes use of the fact that we know how moveable
-// is implemented on set (via swap). If the implementation changed
-// this test may begin to fail.
-
-#include <unordered_set>
-#include <utility>
-#include <testsuite_hooks.h>
-
-int main()
-{
-  bool test __attribute__((unused)) = true;
-
-  std::unordered_multiset<int> a,b;
-  a.insert(2);
-  b.insert(1);
-  b = std::move(a);
-  VERIFY( b.find(2) != b.end() && a.find(1) == a.end() );
-
-  std::unordered_multiset<int> c(std::move(b));
-  VERIFY( c.find(2) != c.end() );
-  VERIFY( b.find(2) == b.end() );
-  return 0;
-}
Index: testsuite/23_containers/map/cons/self_move_assign.cc
===================================================================
--- testsuite/23_containers/map/cons/self_move_assign.cc	(revision 0)
+++ testsuite/23_containers/map/cons/self_move_assign.cc	(revision 0)
@@ -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;
+}
Index: testsuite/23_containers/map/moveable.cc
===================================================================
--- testsuite/23_containers/map/moveable.cc	(revision 155741)
+++ testsuite/23_containers/map/moveable.cc	(working copy)
@@ -1,43 +0,0 @@
-// { 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/>.
-
-
-// NOTE: This makes use of the fact that we know how moveable
-// is implemented on map (via swap). If the implementation changed
-// this test may begin to fail.
-
-#include <map>
-#include <utility>
-#include <testsuite_hooks.h>
-
-int main()
-{
-  bool test __attribute__((unused)) = true;
-
-  std::map<int, int> a,b;
-  a[2]=0;
-  b[1]=0;
-  b = std::move(a);
-  VERIFY(b.find(2) != b.end() && a.find(1) == a.end());
-
-  std::map<int, int> c(std::move(b));
-  VERIFY( c.find(2) != c.end());
-  VERIFY( b.find(2) == b.end());
-  return 0;
-}

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [v3] Fix move assignment operators vs self assignment
  2010-01-09  2:53 [v3] Fix move assignment operators vs self assignment Paolo Carlini
@ 2010-01-09 10:13 ` Bo Persson
  2010-01-09 10:30   ` Paolo Carlini
  0 siblings, 1 reply; 4+ messages in thread
From: Bo Persson @ 2010-01-09 10:13 UTC (permalink / raw)
  To: Paolo Carlini, gcc-patches; +Cc: libstdc++

Paolo Carlini wrote:

> Hi,
>
> a serious oversight, sorry. Tested x86_64-linux, committed to
> mainline.
>
> Paolo.
>
> /////////////////

I believe this might not be a serious oversight at all, but rather an 
early implementation of the resolution to Library Issue #1204.

http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-active.html#1204

where it says:

"Additionally this clarifies that move assignment operators need not 
perform the traditional if (this != &rhs) test commonly found (and 
needed) in copy assignment operators."


The only way to get a move self assignment is to use x = std::move(x). 
If you actually do that, the library might not be required to save 
you.



Bo Persson

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [v3] Fix move assignment operators vs self assignment
  2010-01-09 10:13 ` Bo Persson
@ 2010-01-09 10:30   ` Paolo Carlini
  2010-01-09 11:18     ` Paolo Carlini
  0 siblings, 1 reply; 4+ messages in thread
From: Paolo Carlini @ 2010-01-09 10:30 UTC (permalink / raw)
  To: Bo Persson; +Cc: gcc-patches, libstdc++

On 01/09/2010 11:14 AM, Bo Persson wrote:
> I believe this might not be a serious oversight at all, but rather an
> early implementation of the resolution to Library Issue #1204.
>
> http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-active.html#1204
>
> where it says:
>
> "Additionally this clarifies that move assignment operators need not
> perform the traditional if (this != &rhs) test commonly found (and
> needed) in copy assignment operators."
Gosh, thanks Bo. Something in my head was telling me that I had read
before something about that but couldn't really remember and then found
a very simple testcase which evidently didn't behave like move
assignment operators of library containers should, in general (Table 91)
(also, forward_list and the new experimental string were doing the check)

So, I guess, I will revert the thing, fix forward_list and __vstring,
and add a HUGE comment mentioning DR 1204.


Thanks,
Paolo (some work wasted yesterday but much less ashamed ;)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [v3] Fix move assignment operators vs self assignment
  2010-01-09 10:30   ` Paolo Carlini
@ 2010-01-09 11:18     ` Paolo Carlini
  0 siblings, 0 replies; 4+ messages in thread
From: Paolo Carlini @ 2010-01-09 11:18 UTC (permalink / raw)
  To: Bo Persson; +Cc: gcc-patches, libstdc++

[-- Attachment #1: Type: text/plain, Size: 177 bytes --]

Hi again,
> So, I guess, I will revert the thing, fix forward_list and __vstring,
> and add a HUGE comment mentioning DR 1204.
>   
Done with the below.

Paolo.

//////////////

[-- Attachment #2: CL_self_move_assign_revert --]
[-- Type: text/plain, Size: 3611 bytes --]

2010-01-09  Paolo Carlini  <paolo.carlini@oracle.com>

	* include/debug/set.h: Revert last change, per DR 1204 [Ready];
	mention the latter in comment.
	* 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/bits/forward_list.h: Remove pre-existing check.
	* include/ext/vstring.h: Likewise.

	* testsuite/ext/vstring/cons/self_move_assign.cc: Remove.
	* 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/forward_list/requirements/dr438/
	assign_neg.cc: Likewise.
	* 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.
	* 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.

[-- Attachment #3: patch_self_move_assign_revert --]
[-- Type: text/plain, Size: 45451 bytes --]

Index: include/debug/set.h
===================================================================
--- include/debug/set.h	(revision 155755)
+++ include/debug/set.h	(working copy)
@@ -113,12 +113,10 @@
       set&
       operator=(set&& __x)
       {
-	if (this != &__x)
-	  {
-	    // NB: DR 675.
-	    clear();
-	    swap(__x);
-	  }
+	// NB: DR 1204.
+	// NB: DR 675.
+	clear();
+	swap(__x);
 	return *this;
       }
 
Index: include/debug/unordered_map
===================================================================
--- include/debug/unordered_map	(revision 155755)
+++ include/debug/unordered_map	(working copy)
@@ -115,12 +115,10 @@
       unordered_map&
       operator=(unordered_map&& __x)
       {
-   	if (this != &__x)
-	  {
-	    // NB: DR 675.
-	    clear();
-	    swap(__x);
-	  }
+   	// NB: DR 1204.
+	// NB: DR 675.
+	clear();
+	swap(__x);
 	return *this;
       }
 
@@ -391,12 +389,10 @@
       unordered_multimap&
       operator=(unordered_multimap&& __x)
       {
-	if (this != &__x)
-	  {
-	    // NB: DR 675.
-	    clear();
-	    swap(__x);
-	  }
+	// NB: DR 1204.
+	// NB: DR 675.
+	clear();
+	swap(__x);
 	return *this;
       }
 
Index: include/debug/multiset.h
===================================================================
--- include/debug/multiset.h	(revision 155755)
+++ include/debug/multiset.h	(working copy)
@@ -113,12 +113,10 @@
       multiset&
       operator=(multiset&& __x)
       {
-	if (this != &__x)
-	  {
-	    // NB: DR 675.
-	    clear();
-	    swap(__x);
-	  }
+	// NB: DR 1204.
+	// NB: DR 675.
+	clear();
+	swap(__x);
 	return *this;
       }
 
Index: include/debug/unordered_set
===================================================================
--- include/debug/unordered_set	(revision 155755)
+++ include/debug/unordered_set	(working copy)
@@ -115,12 +115,10 @@
       unordered_set&
       operator=(unordered_set&& __x)
       {
-	if (this != &__x)
-	  {
-	    // NB: DR 675.
-	    clear();
-	    swap(__x);
-	  }
+	// NB: DR 1204.
+	// NB: DR 675.
+	clear();
+	swap(__x);
 	return *this;
       }
 
@@ -389,6 +387,7 @@
       unordered_multiset&
       operator=(unordered_multiset&& __x)
       {
+	// NB: DR 1204.
         // NB: DR 675.
 	clear();
 	swap(__x);
Index: include/debug/vector
===================================================================
--- include/debug/vector	(revision 155755)
+++ include/debug/vector	(working copy)
@@ -124,12 +124,10 @@
       vector&
       operator=(vector&& __x)
       {
-	if (this != &__x)
-	  {
-	    // NB: DR 675.
-	    clear();
-	    swap(__x);
-	  }
+	// NB: DR 1204.
+	// NB: DR 675.
+	clear();
+	swap(__x);
 	return *this;
       }
 
Index: include/debug/map.h
===================================================================
--- include/debug/map.h	(revision 155755)
+++ include/debug/map.h	(working copy)
@@ -115,12 +115,10 @@
       map&
       operator=(map&& __x)
       {
-	if (this != &__x)
-	  {
-	    // NB: DR 675.
-	    clear();
-	    swap(__x);
-	  }
+	// NB: DR 1204.
+	// NB: DR 675.
+	clear();
+	swap(__x);
 	return *this;
       }
 
Index: include/debug/deque
===================================================================
--- include/debug/deque	(revision 155755)
+++ include/debug/deque	(working copy)
@@ -110,12 +110,10 @@
       deque&
       operator=(deque&& __x)
       {
-	if (this != &__x)
-	  {
-	    // NB: DR 675.
-	    clear();
-	    swap(__x);
-	  }	  
+	// NB: DR 1204.
+	// NB: DR 675.
+	clear();
+	swap(__x);
 	return *this;
       }
 
Index: include/debug/list
===================================================================
--- include/debug/list	(revision 155755)
+++ include/debug/list	(working copy)
@@ -112,13 +112,11 @@
       list&
       operator=(list&& __x)
       {
-	if (this != &__x)
-	  {
-	    // NB: DR 675.
-	    clear();
-	    swap(__x);
-	  }
-	return *this;
+	// NB: DR 1204.
+	// NB: DR 675.
+	clear();
+	swap(__x);
+      	return *this;
       }
 
       list&
Index: include/debug/multimap.h
===================================================================
--- include/debug/multimap.h	(revision 155755)
+++ include/debug/multimap.h	(working copy)
@@ -116,12 +116,10 @@
       multimap&
       operator=(multimap&& __x)
       {
-	if (this != &__x)
-	  {
-	    // NB: DR 675.
-	    clear();
-	    swap(__x);
-	  }
+	// NB: DR 1204.
+	// NB: DR 675.
+	clear();
+	swap(__x);
 	return *this;
       }
 
Index: include/tr1_impl/unordered_map
===================================================================
--- include/tr1_impl/unordered_map	(revision 155755)
+++ include/tr1_impl/unordered_map	(working copy)
@@ -229,12 +229,10 @@
       unordered_map&
       operator=(unordered_map&& __x)
       {
-	if (this != &__x)
-	  {
-	    // NB: DR 675.
-	    this->clear();
-	    this->swap(__x);
-	  } 
+	// NB: DR 1204.
+	// NB: DR 675.
+	this->clear();
+	this->swap(__x);
 	return *this;	
       }
 
@@ -315,12 +313,10 @@
       unordered_multimap&
       operator=(unordered_multimap&& __x)
       {
-	if (this != &__x)
-	  {
-	    // NB: DR 675.
-	    this->clear();
-	    this->swap(__x);
-	  } 
+	// NB: DR 1204.
+	// NB: DR 675.
+	this->clear();
+	this->swap(__x);
 	return *this;	
       }
 
Index: include/tr1_impl/unordered_set
===================================================================
--- include/tr1_impl/unordered_set	(revision 155755)
+++ include/tr1_impl/unordered_set	(working copy)
@@ -222,12 +222,10 @@
       unordered_set&
       operator=(unordered_set&& __x)
       {
-	if (this != &__x)
-	  {
-	    // NB: DR 675.
-	    this->clear();
-	    this->swap(__x);
-	  } 
+	// NB: DR 1204.
+	// NB: DR 675.
+	this->clear();
+	this->swap(__x);
 	return *this;	
       }
 
@@ -305,12 +303,10 @@
       unordered_multiset&
       operator=(unordered_multiset&& __x)
       {
-	if (this != &__x)
-	  {
-	    // NB: DR 675.
-	    this->clear();
-	    this->swap(__x);
-	  } 
+	// NB: DR 1204.
+	// NB: DR 675.
+	this->clear();
+	this->swap(__x);
 	return *this;	
       }
 
Index: include/profile/set.h
===================================================================
--- include/profile/set.h	(revision 155755)
+++ include/profile/set.h	(working copy)
@@ -104,12 +104,10 @@
       set&
       operator=(set&& __x)
       {
-	if (this != &__x)
-	  {
-	    // NB: DR 675.
-	    this->clear();
-	    this->swap(__x);
-	  }
+	// NB: DR 1204.
+	// NB: DR 675.
+	this->clear();
+	this->swap(__x);
 	return *this;
       }
 
Index: include/profile/unordered_map
===================================================================
--- include/profile/unordered_map	(revision 155755)
+++ include/profile/unordered_map	(working copy)
@@ -130,12 +130,10 @@
       unordered_map&
       operator=(unordered_map&& __x)
       {
-	if (this != &__x)
-	  {
-	    // NB: DR 675.
-	    this->clear();
-	    this->swap(__x);
-	  }
+	// NB: DR 1204.
+	// NB: DR 675.
+	this->clear();
+	this->swap(__x);
 	return *this;
       }
 
@@ -358,12 +356,10 @@
       unordered_multimap&
       operator=(unordered_multimap&& __x)
       {
-	if (this != &__x)
-	  {
-	    // NB: DR 675.
-	    this->clear();
-	    this->swap(__x);
-	  }
+	// NB: DR 1204.
+	// NB: DR 675.
+	this->clear();
+	this->swap(__x);
 	return *this;
       }
 
Index: include/profile/multiset.h
===================================================================
--- include/profile/multiset.h	(revision 155755)
+++ include/profile/multiset.h	(working copy)
@@ -104,12 +104,10 @@
       multiset&
       operator=(multiset&& __x)
       {
-	if (this != &__x)
-	  {
-	    // NB: DR 675.
-	    this->clear();
-	    this->swap(__x);
-	  }
+	// NB: DR 1204.
+	// NB: DR 675.
+	this->clear();
+	this->swap(__x);
 	return *this;
       }
 
Index: include/profile/vector
===================================================================
--- include/profile/vector	(revision 155755)
+++ include/profile/vector	(working copy)
@@ -140,13 +140,11 @@
       vector&
       operator=(vector&& __x)
       {
-	if (this != &__x)
-	  {
-	    // NB: DR 675.
-	    this->clear();
-	    this->swap(__x);
-	  }
-        return *this;
+	// NB: DR 1204.
+	// NB: DR 675.
+	this->clear();
+	this->swap(__x);
+	return *this;
       }
 
       vector&
Index: include/profile/unordered_set
===================================================================
--- include/profile/unordered_set	(revision 155755)
+++ include/profile/unordered_set	(working copy)
@@ -129,12 +129,10 @@
       unordered_set&
       operator=(unordered_set&& __x)
       {
-	if (this != &__x)
-	  {
-	    // NB: DR 675.
-	    this->clear();
-	    this->swap(__x);
-	  }
+	// NB: DR 1204.
+	// NB: DR 675.
+	this->clear();
+	this->swap(__x);
 	return *this;
       }
 
@@ -346,12 +344,10 @@
       unordered_multiset&
       operator=(unordered_multiset&& __x)
       {
-	if (this != &__x)
-	  {
-	    // NB: DR 675.
-	    this->clear();
-	    this->swap(__x);
-	  }
+	// NB: DR 1204.
+	// NB: DR 675.
+	this->clear();
+	this->swap(__x);
 	return *this;
       }
 
Index: include/profile/map.h
===================================================================
--- include/profile/map.h	(revision 155755)
+++ include/profile/map.h	(working copy)
@@ -121,12 +121,10 @@
       map&
       operator=(map&& __x)
       {
-	if (this != &__x)
-	  {
-	    // NB: DR 675.
-	    this->clear();
-	    this->swap(__x);
-	  }
+	// NB: DR 1204.
+	// NB: DR 675.
+	this->clear();
+	this->swap(__x);
 	return *this;
       }
 
Index: include/profile/deque
===================================================================
--- include/profile/deque	(revision 155755)
+++ include/profile/deque	(working copy)
@@ -102,12 +102,10 @@
       deque&
       operator=(deque&& __x)
       {
-	if (this != &__x)
-	  {
-	    // NB: DR 675.
-	    this->clear();
-	    this->swap(__x);
-	  }  
+	// NB: DR 1204.
+	// NB: DR 675.
+	this->clear();
+	this->swap(__x);
 	return *this;
       }
 
Index: include/profile/list
===================================================================
--- include/profile/list	(revision 155755)
+++ include/profile/list	(working copy)
@@ -102,12 +102,10 @@
       list&
       operator=(list&& __x)
       {
-	if (this != &__x)
-	  {
-	    // NB: DR 675.
-	    this->clear();
-	    this->swap(__x);
-	  }
+	// NB: DR 1204.
+	// NB: DR 675.
+	this->clear();
+	this->swap(__x);
 	return *this;
       }
 
Index: include/profile/multimap.h
===================================================================
--- include/profile/multimap.h	(revision 155755)
+++ include/profile/multimap.h	(working copy)
@@ -106,12 +106,10 @@
       multimap&
       operator=(multimap&& __x)
       {
-	if (this != &__x)
-	  {
-	    // NB: DR 675.
-	    this->clear();
-	    this->swap(__x);
-	  }
+	// NB: DR 1204.
+	// NB: DR 675.
+	this->clear();
+	this->swap(__x);
 	return *this;
       }
 
Index: include/ext/vstring.h
===================================================================
--- include/ext/vstring.h	(revision 155755)
+++ include/ext/vstring.h	(working copy)
@@ -260,11 +260,10 @@
       __versa_string&
       operator=(__versa_string&& __str)
       {
-	if (this != &__str)
-	  {
-	    this->clear();
-	    this->swap(__str);
-	  }
+	// NB: DR 1204.
+	// NB: DR 675.
+	this->clear();
+	this->swap(__str);
 	return *this;
       }
 
Index: include/bits/stl_list.h
===================================================================
--- include/bits/stl_list.h	(revision 155755)
+++ include/bits/stl_list.h	(working copy)
@@ -606,12 +606,10 @@
       list&
       operator=(list&& __x)
       {
-	if (this != &__x)
-	  {
-	    // NB: DR 675.
-	    this->clear();
-	    this->swap(__x);
-	  }
+	// NB: DR 1204.
+	// NB: DR 675.
+	this->clear();
+	this->swap(__x);
 	return *this;
       }
 
Index: include/bits/stl_map.h
===================================================================
--- include/bits/stl_map.h	(revision 155755)
+++ include/bits/stl_map.h	(working copy)
@@ -265,12 +265,10 @@
       map&
       operator=(map&& __x)
       {
-	if (this != &__x)
-	  {
-	    // NB: DR 675.
-	    this->clear();
-	    this->swap(__x);
-	  } 
+	// NB: DR 1204.
+	// NB: DR 675.
+	this->clear();
+	this->swap(__x);
 	return *this;
       }
 
Index: include/bits/stl_set.h
===================================================================
--- include/bits/stl_set.h	(revision 155755)
+++ include/bits/stl_set.h	(working copy)
@@ -241,13 +241,11 @@
       set&
       operator=(set&& __x)
       {
-	if (this != &__x)
-	  {
-	    // NB: DR 675.
-	    this->clear();
-	    this->swap(__x);
-	  } 
-	return *this;
+	// NB: DR 1204.
+	// NB: DR 675.
+	this->clear();
+	this->swap(__x);
+      	return *this;
       }
 
       /**
Index: include/bits/forward_list.h
===================================================================
--- include/bits/forward_list.h	(revision 155755)
+++ include/bits/forward_list.h	(working copy)
@@ -554,12 +554,11 @@
       forward_list&
       operator=(forward_list&& __list)
       {
-        if (&__list != this)
-          {
-            this->clear();
-            this->swap(__list);
-          }
-        return *this;
+	// NB: DR 1204.
+	// NB: DR 675.
+	this->clear();
+	this->swap(__list);
+	return *this;
       }
 
       /**
Index: include/bits/stl_multimap.h
===================================================================
--- include/bits/stl_multimap.h	(revision 155755)
+++ include/bits/stl_multimap.h	(working copy)
@@ -262,12 +262,10 @@
       multimap&
       operator=(multimap&& __x)
       {
-	if (this != &__x)
-	  {
-	    // NB: DR 675.
-	    this->clear();
-	    this->swap(__x);
-	  } 
+	// NB: DR 1204.
+	// NB: DR 675.
+	this->clear();
+	this->swap(__x);
 	return *this;
       }
 
Index: include/bits/stl_vector.h
===================================================================
--- include/bits/stl_vector.h	(revision 155755)
+++ include/bits/stl_vector.h	(working copy)
@@ -335,12 +335,10 @@
       vector&
       operator=(vector&& __x)
       {
-	if (this != &__x)
-	  {
-	    // NB: DR 675.
-	    this->clear();
-	    this->swap(__x);
-	  } 
+	// NB: DR 1204.
+	// NB: DR 675.
+	this->clear();
+	this->swap(__x);
 	return *this;
       }
 
Index: include/bits/stl_deque.h
===================================================================
--- include/bits/stl_deque.h	(revision 155755)
+++ include/bits/stl_deque.h	(working copy)
@@ -884,12 +884,10 @@
       deque&
       operator=(deque&& __x)
       {
-	if (this != &__x)
-	  {
-	    // NB: DR 675.
-	    this->clear();
-	    this->swap(__x);
-	  } 
+	// NB: DR 1204.
+	// NB: DR 675.
+	this->clear();
+	this->swap(__x);
 	return *this;
       }
 
Index: include/bits/stl_multiset.h
===================================================================
--- include/bits/stl_multiset.h	(revision 155755)
+++ include/bits/stl_multiset.h	(working copy)
@@ -234,12 +234,10 @@
       multiset&
       operator=(multiset&& __x)
       {
-	if (this != &__x)
-	  {
-	    // NB: DR 675.
-	    this->clear();
-	    this->swap(__x);
-	  }
+	// NB: DR 1204.
+	// NB: DR 675.
+	this->clear();
+	this->swap(__x);
 	return *this;
       }
 
Index: include/bits/stl_bvector.h
===================================================================
--- include/bits/stl_bvector.h	(revision 155755)
+++ include/bits/stl_bvector.h	(working copy)
@@ -565,6 +565,7 @@
     vector&
     operator=(vector&& __x)
     {
+      // NB: DR 1204.
       // NB: DR 675.
       this->clear();
       this->swap(__x); 
Index: testsuite/ext/vstring/cons/self_move_assign.cc
===================================================================
--- testsuite/ext/vstring/cons/self_move_assign.cc	(revision 155755)
+++ testsuite/ext/vstring/cons/self_move_assign.cc	(working copy)
@@ -1,41 +0,0 @@
-// { 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;
-}
Index: testsuite/23_containers/unordered_map/cons/self_move_assign.cc
===================================================================
--- testsuite/23_containers/unordered_map/cons/self_move_assign.cc	(revision 155755)
+++ testsuite/23_containers/unordered_map/cons/self_move_assign.cc	(working copy)
@@ -1,44 +0,0 @@
-// { 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;
-}
Index: testsuite/23_containers/multimap/cons/self_move_assign.cc
===================================================================
--- testsuite/23_containers/multimap/cons/self_move_assign.cc	(revision 155755)
+++ testsuite/23_containers/multimap/cons/self_move_assign.cc	(working copy)
@@ -1,44 +0,0 @@
-// { 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;
-}
Index: testsuite/23_containers/set/cons/self_move_assign.cc
===================================================================
--- testsuite/23_containers/set/cons/self_move_assign.cc	(revision 155755)
+++ testsuite/23_containers/set/cons/self_move_assign.cc	(working copy)
@@ -1,43 +0,0 @@
-// { 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;
-}
Index: testsuite/23_containers/unordered_multimap/cons/self_move_assign.cc
===================================================================
--- testsuite/23_containers/unordered_multimap/cons/self_move_assign.cc	(revision 155755)
+++ testsuite/23_containers/unordered_multimap/cons/self_move_assign.cc	(working copy)
@@ -1,44 +0,0 @@
-// { 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;
-}
Index: testsuite/23_containers/forward_list/cons/self_move_assign.cc
===================================================================
--- testsuite/23_containers/forward_list/cons/self_move_assign.cc	(revision 155755)
+++ testsuite/23_containers/forward_list/cons/self_move_assign.cc	(working copy)
@@ -1,40 +0,0 @@
-// { 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 <forward_list>
-#include <testsuite_hooks.h>
-
-void test01()
-{
-  bool test __attribute__((unused)) = true;
-
-  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 );
-}
-
-int main()
-{
-  test01();
-  return 0;
-}
Index: testsuite/23_containers/forward_list/requirements/dr438/assign_neg.cc
===================================================================
--- testsuite/23_containers/forward_list/requirements/dr438/assign_neg.cc	(revision 155755)
+++ testsuite/23_containers/forward_list/requirements/dr438/assign_neg.cc	(working copy)
@@ -1,9 +1,9 @@
 // { dg-do compile }
 // { dg-options "-std=gnu++0x" }
-// { dg-error "no matching" "" { target *-*-* } 1197 }
+// { dg-error "no matching" "" { target *-*-* } 1196 }
 // { dg-excess-errors "" }
 
-// Copyright (C) 2009 Free Software Foundation
+// Copyright (C) 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
Index: testsuite/23_containers/forward_list/requirements/dr438/insert_neg.cc
===================================================================
--- testsuite/23_containers/forward_list/requirements/dr438/insert_neg.cc	(revision 155755)
+++ testsuite/23_containers/forward_list/requirements/dr438/insert_neg.cc	(working copy)
@@ -1,9 +1,9 @@
 // { dg-do compile }
 // { dg-options "-std=gnu++0x" }
-// { dg-error "no matching" "" { target *-*-* } 1197 }
+// { dg-error "no matching" "" { target *-*-* } 1196 }
 // { dg-excess-errors "" }
 
-// Copyright (C) 2009 Free Software Foundation
+// Copyright (C) 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
Index: testsuite/23_containers/forward_list/requirements/dr438/constructor_1_neg.cc
===================================================================
--- testsuite/23_containers/forward_list/requirements/dr438/constructor_1_neg.cc	(revision 155755)
+++ testsuite/23_containers/forward_list/requirements/dr438/constructor_1_neg.cc	(working copy)
@@ -1,9 +1,9 @@
 // { dg-do compile }
 // { dg-options "-std=gnu++0x" }
-// { dg-error "no matching" "" { target *-*-* } 1197 }
+// { dg-error "no matching" "" { target *-*-* } 1196 }
 // { dg-excess-errors "" }
 
-// Copyright (C) 2009 Free Software Foundation
+// Copyright (C) 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
Index: testsuite/23_containers/forward_list/requirements/dr438/constructor_2_neg.cc
===================================================================
--- testsuite/23_containers/forward_list/requirements/dr438/constructor_2_neg.cc	(revision 155755)
+++ testsuite/23_containers/forward_list/requirements/dr438/constructor_2_neg.cc	(working copy)
@@ -1,9 +1,9 @@
 // { dg-do compile }
 // { dg-options "-std=gnu++0x" }
-// { dg-error "no matching" "" { target *-*-* } 1197 }
+// { dg-error "no matching" "" { target *-*-* } 1196 }
 // { dg-excess-errors "" }
 
-// Copyright (C) 2009 Free Software Foundation
+// Copyright (C) 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
Index: testsuite/23_containers/unordered_set/cons/self_move_assign.cc
===================================================================
--- testsuite/23_containers/unordered_set/cons/self_move_assign.cc	(revision 155755)
+++ testsuite/23_containers/unordered_set/cons/self_move_assign.cc	(working copy)
@@ -1,43 +0,0 @@
-// { 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: testsuite/23_containers/vector/requirements/dr438/assign_neg.cc
===================================================================
--- testsuite/23_containers/vector/requirements/dr438/assign_neg.cc	(revision 155755)
+++ testsuite/23_containers/vector/requirements/dr438/assign_neg.cc	(working copy)
@@ -18,7 +18,7 @@
 // <http://www.gnu.org/licenses/>.
 
 // { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1057 }
+// { dg-error "no matching" "" { target *-*-* } 1055 }
 // { dg-excess-errors "" }
 
 #include <vector>
Index: testsuite/23_containers/vector/requirements/dr438/insert_neg.cc
===================================================================
--- testsuite/23_containers/vector/requirements/dr438/insert_neg.cc	(revision 155755)
+++ testsuite/23_containers/vector/requirements/dr438/insert_neg.cc	(working copy)
@@ -18,7 +18,7 @@
 // <http://www.gnu.org/licenses/>.
 
 // { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1098 }
+// { dg-error "no matching" "" { target *-*-* } 1096 }
 // { dg-excess-errors "" }
 
 #include <vector>
Index: testsuite/23_containers/vector/requirements/dr438/constructor_1_neg.cc
===================================================================
--- testsuite/23_containers/vector/requirements/dr438/constructor_1_neg.cc	(revision 155755)
+++ testsuite/23_containers/vector/requirements/dr438/constructor_1_neg.cc	(working copy)
@@ -18,7 +18,7 @@
 // <http://www.gnu.org/licenses/>.
 
 // { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 997 }
+// { dg-error "no matching" "" { target *-*-* } 995 }
 // { dg-excess-errors "" }
 
 #include <vector>
Index: testsuite/23_containers/vector/requirements/dr438/constructor_2_neg.cc
===================================================================
--- testsuite/23_containers/vector/requirements/dr438/constructor_2_neg.cc	(revision 155755)
+++ testsuite/23_containers/vector/requirements/dr438/constructor_2_neg.cc	(working copy)
@@ -18,7 +18,7 @@
 // <http://www.gnu.org/licenses/>.
 
 // { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 997 }
+// { dg-error "no matching" "" { target *-*-* } 995 }
 // { dg-excess-errors "" }
 
 #include <vector>
Index: testsuite/23_containers/vector/cons/self_move_assign.cc
===================================================================
--- testsuite/23_containers/vector/cons/self_move_assign.cc	(revision 155755)
+++ testsuite/23_containers/vector/cons/self_move_assign.cc	(working copy)
@@ -1,40 +0,0 @@
-// { 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 <vector>
-#include <testsuite_hooks.h>
-
-void test01()
-{
-  bool test __attribute__((unused)) = true;
-
-  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()
-{
-  test01();
-  return 0;
-}
Index: testsuite/23_containers/deque/cons/self_move_assign.cc
===================================================================
--- testsuite/23_containers/deque/cons/self_move_assign.cc	(revision 155755)
+++ testsuite/23_containers/deque/cons/self_move_assign.cc	(working copy)
@@ -1,40 +0,0 @@
-// { 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: testsuite/23_containers/deque/requirements/dr438/assign_neg.cc
===================================================================
--- testsuite/23_containers/deque/requirements/dr438/assign_neg.cc	(revision 155755)
+++ testsuite/23_containers/deque/requirements/dr438/assign_neg.cc	(working copy)
@@ -18,7 +18,7 @@
 // <http://www.gnu.org/licenses/>.
 
 // { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1578 }
+// { dg-error "no matching" "" { target *-*-* } 1576 }
 // { dg-excess-errors "" }
 
 #include <deque>
Index: testsuite/23_containers/deque/requirements/dr438/insert_neg.cc
===================================================================
--- testsuite/23_containers/deque/requirements/dr438/insert_neg.cc	(revision 155755)
+++ testsuite/23_containers/deque/requirements/dr438/insert_neg.cc	(working copy)
@@ -18,7 +18,7 @@
 // <http://www.gnu.org/licenses/>.
 
 // { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1662 }
+// { dg-error "no matching" "" { target *-*-* } 1660 }
 // { dg-excess-errors "" }
 
 #include <deque>
Index: testsuite/23_containers/deque/requirements/dr438/constructor_1_neg.cc
===================================================================
--- testsuite/23_containers/deque/requirements/dr438/constructor_1_neg.cc	(revision 155755)
+++ testsuite/23_containers/deque/requirements/dr438/constructor_1_neg.cc	(working copy)
@@ -18,7 +18,7 @@
 // <http://www.gnu.org/licenses/>.
 
 // { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1517 }
+// { dg-error "no matching" "" { target *-*-* } 1515 }
 // { dg-excess-errors "" }
 
 #include <deque>
Index: testsuite/23_containers/deque/requirements/dr438/constructor_2_neg.cc
===================================================================
--- testsuite/23_containers/deque/requirements/dr438/constructor_2_neg.cc	(revision 155755)
+++ testsuite/23_containers/deque/requirements/dr438/constructor_2_neg.cc	(working copy)
@@ -18,7 +18,7 @@
 // <http://www.gnu.org/licenses/>.
 
 // { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1517 }
+// { dg-error "no matching" "" { target *-*-* } 1515 }
 // { dg-excess-errors "" }
 
 #include <deque>
Index: testsuite/23_containers/multiset/cons/self_move_assign.cc
===================================================================
--- testsuite/23_containers/multiset/cons/self_move_assign.cc	(revision 155755)
+++ testsuite/23_containers/multiset/cons/self_move_assign.cc	(working copy)
@@ -1,43 +0,0 @@
-// { 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;
-}
Index: testsuite/23_containers/list/requirements/dr438/assign_neg.cc
===================================================================
--- testsuite/23_containers/list/requirements/dr438/assign_neg.cc	(revision 155755)
+++ testsuite/23_containers/list/requirements/dr438/assign_neg.cc	(working copy)
@@ -18,7 +18,7 @@
 // <http://www.gnu.org/licenses/>.
 
 // { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1412 }
+// { dg-error "no matching" "" { target *-*-* } 1410 }
 // { dg-excess-errors "" }
 
 #include <list>
Index: testsuite/23_containers/list/requirements/dr438/insert_neg.cc
===================================================================
--- testsuite/23_containers/list/requirements/dr438/insert_neg.cc	(revision 155755)
+++ testsuite/23_containers/list/requirements/dr438/insert_neg.cc	(working copy)
@@ -18,7 +18,7 @@
 // <http://www.gnu.org/licenses/>.
 
 // { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1381 }
+// { dg-error "no matching" "" { target *-*-* } 1379 }
 // { dg-excess-errors "" }
 
 #include <list>
Index: testsuite/23_containers/list/requirements/dr438/constructor_1_neg.cc
===================================================================
--- testsuite/23_containers/list/requirements/dr438/constructor_1_neg.cc	(revision 155755)
+++ testsuite/23_containers/list/requirements/dr438/constructor_1_neg.cc	(working copy)
@@ -18,7 +18,7 @@
 // <http://www.gnu.org/licenses/>.
 
 // { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1381 }
+// { dg-error "no matching" "" { target *-*-* } 1379 }
 // { dg-excess-errors "" }
 
 #include <list>
Index: testsuite/23_containers/list/requirements/dr438/constructor_2_neg.cc
===================================================================
--- testsuite/23_containers/list/requirements/dr438/constructor_2_neg.cc	(revision 155755)
+++ testsuite/23_containers/list/requirements/dr438/constructor_2_neg.cc	(working copy)
@@ -18,7 +18,7 @@
 // <http://www.gnu.org/licenses/>.
 
 // { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1381 }
+// { dg-error "no matching" "" { target *-*-* } 1379 }
 // { dg-excess-errors "" }
 
 #include <list>
Index: testsuite/23_containers/list/cons/self_move_assign.cc
===================================================================
--- testsuite/23_containers/list/cons/self_move_assign.cc	(revision 155755)
+++ testsuite/23_containers/list/cons/self_move_assign.cc	(working copy)
@@ -1,40 +0,0 @@
-// { 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: testsuite/23_containers/unordered_multiset/cons/self_move_assign.cc
===================================================================
--- testsuite/23_containers/unordered_multiset/cons/self_move_assign.cc	(revision 155755)
+++ testsuite/23_containers/unordered_multiset/cons/self_move_assign.cc	(working copy)
@@ -1,43 +0,0 @@
-// { 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;
-}
Index: testsuite/23_containers/map/cons/self_move_assign.cc
===================================================================
--- testsuite/23_containers/map/cons/self_move_assign.cc	(revision 155755)
+++ testsuite/23_containers/map/cons/self_move_assign.cc	(working copy)
@@ -1,44 +0,0 @@
-// { 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;
-}

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-01-09 11:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-09  2:53 [v3] Fix move assignment operators vs self assignment Paolo Carlini
2010-01-09 10:13 ` Bo Persson
2010-01-09 10:30   ` Paolo Carlini
2010-01-09 11:18     ` Paolo Carlini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).