* 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
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.
{ 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);
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>
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>
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;
}
int
test02()
{
+ bool test __attribute__((unused)) = true;
+
std::owner_less<std::shared_ptr<A>> less;
std::owner_less<std::weak_ptr<A>> wless;
int
test03()
{
+ bool test __attribute__((unused)) = true;
+
std::owner_less<std::shared_ptr<A>> less;
std::owner_less<std::weak_ptr<A>> wless;
int
test04()
{
+ bool test __attribute__((unused)) = true;
+
std::owner_less<std::shared_ptr<A>> less;
std::shared_ptr<A> a[3];
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;
}
int
test02()
{
+ bool test __attribute__((unused)) = true;
+
std::shared_ptr<A> A_default;
std::shared_ptr<A> A_from_A(new A);
int
test03()
{
+ bool test __attribute__((unused)) = true;
+
std::shared_ptr<A> p1;
// check other operators are defined
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;
int
test02()
{
+ bool test __attribute__((unused)) = true;
+
std::less<std::shared_ptr<A>> less;
std::shared_ptr<A> empty;
int
test03()
{
+ bool test __attribute__((unused)) = true;
+
std::less<std::shared_ptr<A>> less;
A a;
void test01()
{
+ bool test __attribute__((unused)) = true;
+
std::tuple<> t1, t2;
std::swap(t1, t2);
int
test01()
{
+ bool test __attribute__((unused)) = true;
+
// test empty weak_ptrs compare equivalent
std::weak_ptr<A> p1;
std::weak_ptr<B> p2;
int
test02()
{
+ bool test __attribute__((unused)) = true;
+
std::shared_ptr<A> a0;
std::weak_ptr<A> w0(a0);