Patchwork [v3] libstdc++/46821

login
register
mail settings
Submitter Paolo Carlini
Date Dec. 6, 2010, 2:47 p.m.
Message ID <4CFCF78C.2010400@oracle.com>
Download mbox | patch
Permalink /patch/74374/
State New
Headers show

Comments

Paolo Carlini - Dec. 6, 2010, 2:47 p.m.
Hi,

tested x86_64-linux, committed to mainline.

Paolo.

////////////////////
2010-12-06  Paolo Carlini  <paolo.carlini@oracle.com>

	PR libstdc++/46821
	* include/std/tuple (_Head_base<,, true>::_M_swap_impl):
	Swap the empty bases.
	(_Head_base<,, false>::_M_swap_impl): Minor tweak.
	* testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Adjust dg-error
	line number.

Patch

Index: include/std/tuple
===================================================================
--- include/std/tuple	(revision 167488)
+++ include/std/tuple	(working copy)
@@ -78,7 +78,11 @@ 
       const _Head& _M_head() const { return *this; }
     
       void 
-      _M_swap_impl(_Head&) { /* no-op */ }
+      _M_swap_impl(_Head& __h)
+      {
+	using std::swap;
+	swap(__h, _M_head());
+      }
     };
 
   template<std::size_t _Idx, typename _Head>
@@ -101,7 +105,7 @@ 
       _M_swap_impl(_Head& __h)
       { 
 	using std::swap;
-	swap(__h, _M_head_impl);
+	swap(__h, _M_head());
       }
 
       _Head _M_head_impl; 
Index: testsuite/20_util/weak_ptr/comparison/cmp_neg.cc
===================================================================
--- testsuite/20_util/weak_ptr/comparison/cmp_neg.cc	(revision 167488)
+++ testsuite/20_util/weak_ptr/comparison/cmp_neg.cc	(working copy)
@@ -44,7 +44,7 @@ 
 // { dg-warning "note" "" { target *-*-* } 350 }
 // { dg-warning "note" "" { target *-*-* } 1082 }
 // { dg-warning "note" "" { target *-*-* } 465 }
-// { dg-warning "note" "" { target *-*-* } 581 }
+// { dg-warning "note" "" { target *-*-* } 585 }
 // { dg-warning "note" "" { target *-*-* } 1027 }
 // { dg-warning "note" "" { target *-*-* } 340 }
 // { dg-warning "note" "" { target *-*-* } 290 }