summaryrefslogtreecommitdiff
path: root/libstdc++-v3
diff options
context:
space:
mode:
authorredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>2009-06-23 22:33:17 +0000
committerredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>2009-06-23 22:33:17 +0000
commit9ad39aef4294b32ee578167dbae81fb8fdcb1a00 (patch)
treed9b4e4b65c4bbd99a9ff40405dd86b65b041294b /libstdc++-v3
parent988e7f78efbe698d11c45f63452851e490212788 (diff)
downloadgcc-9ad39aef4294b32ee578167dbae81fb8fdcb1a00.tar.gz
2009-06-23 Jonathan Wakely <jwakely.gcc@gmail.com>
* include/bits/shared_ptr.h: Do not swap rvalues. * testsuite/20_util/owner_less/cmp.cc: Add missing test variables. * testsuite/20_util/shared_ptr/comparison/cmp.cc: Likewise. * testsuite/20_util/shared_ptr/comparison/less.cc: Likewise. * testsuite/20_util/weak_ptr/observers/owner_before.cc: Likewise. * testsuite/20_util/tuple/swap.cc: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@148880 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3')
-rw-r--r--libstdc++-v3/ChangeLog9
-rw-r--r--libstdc++-v3/include/bits/shared_ptr.h22
-rw-r--r--libstdc++-v3/testsuite/20_util/owner_less/cmp.cc28
-rw-r--r--libstdc++-v3/testsuite/20_util/shared_ptr/comparison/cmp.cc20
-rw-r--r--libstdc++-v3/testsuite/20_util/shared_ptr/comparison/less.cc6
-rw-r--r--libstdc++-v3/testsuite/20_util/tuple/swap.cc2
-rw-r--r--libstdc++-v3/testsuite/20_util/weak_ptr/observers/owner_before.cc4
7 files changed, 53 insertions, 38 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index a71f9341c98..1a589dda0da 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,5 +1,14 @@
2009-06-23 Jonathan Wakely <jwakely.gcc@gmail.com>
+ * include/bits/shared_ptr.h: Do not swap rvalues.
+ * testsuite/20_util/owner_less/cmp.cc: Add missing test variables.
+ * testsuite/20_util/shared_ptr/comparison/cmp.cc: Likewise.
+ * testsuite/20_util/shared_ptr/comparison/less.cc: Likewise.
+ * testsuite/20_util/weak_ptr/observers/owner_before.cc: Likewise.
+ * testsuite/20_util/tuple/swap.cc: Likewise.
+
+2009-06-23 Jonathan Wakely <jwakely.gcc@gmail.com>
+
* include/debug/macros.h: Replace @tbd with valid doxygen tag @todo.
* include/std/ratio: Typo in comment.
diff --git a/libstdc++-v3/include/bits/shared_ptr.h b/libstdc++-v3/include/bits/shared_ptr.h
index c7a45f39bc1..81bef585940 100644
--- a/libstdc++-v3/include/bits/shared_ptr.h
+++ b/libstdc++-v3/include/bits/shared_ptr.h
@@ -828,7 +828,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
{ return _M_refcount._M_get_use_count(); }
void
- swap(__shared_ptr<_Tp, _Lp>&& __other) // never throws
+ swap(__shared_ptr<_Tp, _Lp>& __other) // never throws
{
std::swap(_M_ptr, __other._M_ptr);
_M_refcount._M_swap(__other._M_refcount);
@@ -938,16 +938,6 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
swap(__shared_ptr<_Tp, _Lp>& __a, __shared_ptr<_Tp, _Lp>& __b)
{ __a.swap(__b); }
- template<typename _Tp, _Lock_policy _Lp>
- inline void
- swap(__shared_ptr<_Tp, _Lp>&& __a, __shared_ptr<_Tp, _Lp>& __b)
- { __a.swap(__b); }
-
- template<typename _Tp, _Lock_policy _Lp>
- inline void
- swap(__shared_ptr<_Tp, _Lp>& __a, __shared_ptr<_Tp, _Lp>&& __b)
- { __a.swap(__b); }
-
// 2.2.3.9 shared_ptr casts
/** @warning The seemingly equivalent
* <code>shared_ptr<_Tp, _Lp>(static_cast<_Tp*>(__r.get()))</code>
@@ -1367,16 +1357,6 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
swap(shared_ptr<_Tp>& __a, shared_ptr<_Tp>& __b)
{ __a.swap(__b); }
- template<typename _Tp>
- inline void
- swap(shared_ptr<_Tp>&& __a, shared_ptr<_Tp>& __b)
- { __a.swap(__b); }
-
- template<typename _Tp>
- inline void
- swap(shared_ptr<_Tp>& __a, shared_ptr<_Tp>&& __b)
- { __a.swap(__b); }
-
// 20.8.13.2.10 shared_ptr casts.
template<typename _Tp, typename _Tp1>
inline shared_ptr<_Tp>
diff --git a/libstdc++-v3/testsuite/20_util/owner_less/cmp.cc b/libstdc++-v3/testsuite/20_util/owner_less/cmp.cc
index 440ac76a7a1..e1524cc1851 100644
--- a/libstdc++-v3/testsuite/20_util/owner_less/cmp.cc
+++ b/libstdc++-v3/testsuite/20_util/owner_less/cmp.cc
@@ -32,16 +32,18 @@ struct B { A a[2]; };
int
test01()
{
- // test empty shared_ptrs compare equivalent
- std::owner_less<std::shared_ptr<A>> less;
- std::owner_less<std::weak_ptr<A>> wless;
- std::shared_ptr<A> p1;
- std::shared_ptr<A> p2;
- VERIFY( !less(p1, p2) && !less(p2, p1) );
- std::weak_ptr<A> p3;
- VERIFY( !less(p1, p3) && !less(p3, p1) );
- VERIFY( !wless(p1, p3) && !wless(p3, p1) );
- return 0;
+ bool test __attribute__((unused)) = true;
+
+ // test empty shared_ptrs compare equivalent
+ std::owner_less<std::shared_ptr<A>> less;
+ std::owner_less<std::weak_ptr<A>> wless;
+ std::shared_ptr<A> p1;
+ std::shared_ptr<A> p2;
+ VERIFY( !less(p1, p2) && !less(p2, p1) );
+ std::weak_ptr<A> p3;
+ VERIFY( !less(p1, p3) && !less(p3, p1) );
+ VERIFY( !wless(p1, p3) && !wless(p3, p1) );
+ return 0;
}
@@ -49,6 +51,8 @@ test01()
int
test02()
{
+ bool test __attribute__((unused)) = true;
+
std::owner_less<std::shared_ptr<A>> less;
std::owner_less<std::weak_ptr<A>> wless;
@@ -80,6 +84,8 @@ test02()
int
test03()
{
+ bool test __attribute__((unused)) = true;
+
std::owner_less<std::shared_ptr<A>> less;
std::owner_less<std::weak_ptr<A>> wless;
@@ -102,6 +108,8 @@ test03()
int
test04()
{
+ bool test __attribute__((unused)) = true;
+
std::owner_less<std::shared_ptr<A>> less;
std::shared_ptr<A> a[3];
diff --git a/libstdc++-v3/testsuite/20_util/shared_ptr/comparison/cmp.cc b/libstdc++-v3/testsuite/20_util/shared_ptr/comparison/cmp.cc
index 3e9db75802c..9991fa761bc 100644
--- a/libstdc++-v3/testsuite/20_util/shared_ptr/comparison/cmp.cc
+++ b/libstdc++-v3/testsuite/20_util/shared_ptr/comparison/cmp.cc
@@ -36,13 +36,15 @@ struct B : A
int
test01()
{
- // test empty shared_ptrs compare equivalent
- std::shared_ptr<A> p1;
- std::shared_ptr<B> p2;
- VERIFY( p1 == p2 );
- VERIFY( !(p1 != p2) );
- VERIFY( !(p1 < p2) && !(p2 < p1) );
- return 0;
+ bool test __attribute__((unused)) = true;
+
+ // test empty shared_ptrs compare equivalent
+ std::shared_ptr<A> p1;
+ std::shared_ptr<B> p2;
+ VERIFY( p1 == p2 );
+ VERIFY( !(p1 != p2) );
+ VERIFY( !(p1 < p2) && !(p2 < p1) );
+ return 0;
}
@@ -50,6 +52,8 @@ test01()
int
test02()
{
+ bool test __attribute__((unused)) = true;
+
std::shared_ptr<A> A_default;
std::shared_ptr<A> A_from_A(new A);
@@ -78,6 +82,8 @@ test02()
int
test03()
{
+ bool test __attribute__((unused)) = true;
+
std::shared_ptr<A> p1;
// check other operators are defined
diff --git a/libstdc++-v3/testsuite/20_util/shared_ptr/comparison/less.cc b/libstdc++-v3/testsuite/20_util/shared_ptr/comparison/less.cc
index 7f35dbe80d5..b51b222a028 100644
--- a/libstdc++-v3/testsuite/20_util/shared_ptr/comparison/less.cc
+++ b/libstdc++-v3/testsuite/20_util/shared_ptr/comparison/less.cc
@@ -41,6 +41,8 @@ namespace std
int
test01()
{
+ bool test __attribute__((unused)) = true;
+
std::less<std::shared_ptr<A>> less;
// test empty shared_ptrs compare equivalent
std::shared_ptr<A> p1;
@@ -55,6 +57,8 @@ test01()
int
test02()
{
+ bool test __attribute__((unused)) = true;
+
std::less<std::shared_ptr<A>> less;
std::shared_ptr<A> empty;
@@ -77,6 +81,8 @@ test02()
int
test03()
{
+ bool test __attribute__((unused)) = true;
+
std::less<std::shared_ptr<A>> less;
A a;
diff --git a/libstdc++-v3/testsuite/20_util/tuple/swap.cc b/libstdc++-v3/testsuite/20_util/tuple/swap.cc
index 1e65f0521cb..6dab446bfe9 100644
--- a/libstdc++-v3/testsuite/20_util/tuple/swap.cc
+++ b/libstdc++-v3/testsuite/20_util/tuple/swap.cc
@@ -56,6 +56,8 @@ make_move_only (int i)
void test01()
{
+ bool test __attribute__((unused)) = true;
+
std::tuple<> t1, t2;
std::swap(t1, t2);
diff --git a/libstdc++-v3/testsuite/20_util/weak_ptr/observers/owner_before.cc b/libstdc++-v3/testsuite/20_util/weak_ptr/observers/owner_before.cc
index 786e7eb169e..1081f93d338 100644
--- a/libstdc++-v3/testsuite/20_util/weak_ptr/observers/owner_before.cc
+++ b/libstdc++-v3/testsuite/20_util/weak_ptr/observers/owner_before.cc
@@ -30,6 +30,8 @@ struct B { };
int
test01()
{
+ bool test __attribute__((unused)) = true;
+
// test empty weak_ptrs compare equivalent
std::weak_ptr<A> p1;
std::weak_ptr<B> p2;
@@ -45,6 +47,8 @@ test01()
int
test02()
{
+ bool test __attribute__((unused)) = true;
+
std::shared_ptr<A> a0;
std::weak_ptr<A> w0(a0);