From 258e15e073c181d9c880cdaf59fdef9755aa6a4c Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Mon, 6 Dec 2010 14:44:38 +0000 Subject: [PATCH] re PR libstdc++/46821 ([C++0x] swapping empty classes) 2010-12-06 Paolo Carlini 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. From-SVN: r167497 --- libstdc++-v3/ChangeLog | 11 ++++++++++- libstdc++-v3/include/std/tuple | 8 ++++++-- .../testsuite/20_util/weak_ptr/comparison/cmp_neg.cc | 2 +- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 7a5b7f76864..7deae75a391 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,12 @@ +2010-12-06 Paolo Carlini + + 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. + 2010-12-06 Dave Korn PR target/40125 @@ -54,7 +63,7 @@ * testsuite/23_containers/deque/cons/2.cc: Fix to explicitly invoke the copy constructor with or without C++0x mode. * testsuite/23_containers/vector/cons/4.cc: Likewise. - + 2010-12-01 Rainer Orth * scripts/extract_symvers.pl: New file. diff --git a/libstdc++-v3/include/std/tuple b/libstdc++-v3/include/std/tuple index df9ef1d1694..87dbcb78df6 100644 --- a/libstdc++-v3/include/std/tuple +++ b/libstdc++-v3/include/std/tuple @@ -78,7 +78,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std) 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 @@ -101,7 +105,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) _M_swap_impl(_Head& __h) { using std::swap; - swap(__h, _M_head_impl); + swap(__h, _M_head()); } _Head _M_head_impl; diff --git a/libstdc++-v3/testsuite/20_util/weak_ptr/comparison/cmp_neg.cc b/libstdc++-v3/testsuite/20_util/weak_ptr/comparison/cmp_neg.cc index 7f5b109b61e..044a7259e18 100644 --- a/libstdc++-v3/testsuite/20_util/weak_ptr/comparison/cmp_neg.cc +++ b/libstdc++-v3/testsuite/20_util/weak_ptr/comparison/cmp_neg.cc @@ -44,7 +44,7 @@ main() // { 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 }