* include/bits/unique_ptr.h: (unique_ptr<>::
unique_ptr(const unique_ptr<_Up, _Up_Deleter>&),
operator=(const unique_ptr<_Up, _Up_Deleter>&)): Remove, redundant,
per DR 1303.
* include/bits/shared_ptr.h (shared_ptr<>::
shared_ptr(const unique_ptr<_Up, _Up_Deleter>&),
operator=(const unique_ptr<_Up, _Up_Deleter>&)): Likewise.
* include/bits/shared_ptr_base.h (__shared_ptr<>::
__shared_ptr(const unique_ptr<_Up, _Up_Deleter>&),
operator=(const unique_ptr<_Up, _Up_Deleter>&)): Likewise.
* testsuite/20_util/unique_ptr/modifiers/reset_neg.cc: Adjust.
* testsuite/20_util/unique_ptr/assign/assign_neg.cc: Likewise.
* testsuite/20_util/shared_ptr/cons/unique_ptr_neg.cc: Likewise.
* testsuite/20_util/shared_ptr/assign/unique_ptr_lvalue_neg.cc:
Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@156807
138bc75d-0d04-0410-961f-
82ee72b054a4
+2010-02-16 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * include/bits/unique_ptr.h: (unique_ptr<>::
+ unique_ptr(const unique_ptr<_Up, _Up_Deleter>&),
+ operator=(const unique_ptr<_Up, _Up_Deleter>&)): Remove, redundant,
+ per DR 1303.
+ * include/bits/shared_ptr.h (shared_ptr<>::
+ shared_ptr(const unique_ptr<_Up, _Up_Deleter>&),
+ operator=(const unique_ptr<_Up, _Up_Deleter>&)): Likewise.
+ * include/bits/shared_ptr_base.h (__shared_ptr<>::
+ __shared_ptr(const unique_ptr<_Up, _Up_Deleter>&),
+ operator=(const unique_ptr<_Up, _Up_Deleter>&)): Likewise.
+ * testsuite/20_util/unique_ptr/modifiers/reset_neg.cc: Adjust.
+ * testsuite/20_util/unique_ptr/assign/assign_neg.cc: Likewise.
+ * testsuite/20_util/shared_ptr/cons/unique_ptr_neg.cc: Likewise.
+ * testsuite/20_util/shared_ptr/assign/unique_ptr_lvalue_neg.cc:
+ Likewise.
+
2010-02-15 Paolo Carlini <paolo.carlini@oracle.com>
* testsuite/ext/median.cc: Adjust.
/// 2.2.3.7 shared_ptr I/O
template<typename _Ch, typename _Tr, typename _Tp, _Lock_policy _Lp>
- std::basic_ostream<_Ch, _Tr>&
+ inline std::basic_ostream<_Ch, _Tr>&
operator<<(std::basic_ostream<_Ch, _Tr>& __os,
const __shared_ptr<_Tp, _Lp>& __p)
{
*
* __shared_ptr will release __p by calling __d(__p)
*/
- template<typename _Tp1, typename _Deleter>
+ template<typename _Tp1, typename _Deleter>
shared_ptr(_Tp1* __p, _Deleter __d) : __shared_ptr<_Tp>(__p, __d) { }
/**
#endif
template<typename _Tp1, typename _Del>
- explicit shared_ptr(const std::unique_ptr<_Tp1, _Del>&) = delete;
-
- template<typename _Tp1, typename _Del>
explicit shared_ptr(std::unique_ptr<_Tp1, _Del>&& __r)
: __shared_ptr<_Tp>(std::move(__r)) { }
template<typename _Tp1, typename _Del>
shared_ptr&
- operator=(const std::unique_ptr<_Tp1, _Del>& __r) = delete;
-
- template<typename _Tp1, typename _Del>
- shared_ptr&
operator=(std::unique_ptr<_Tp1, _Del>&& __r)
{
this->__shared_ptr<_Tp>::operator=(std::move(__r));
// shared_ptr and weak_ptr implementation details -*- C++ -*-
-// Copyright (C) 2007, 2008, 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
_M_ptr = __r._M_ptr;
}
- template<typename _Tp1, typename _Del>
- explicit __shared_ptr(const std::unique_ptr<_Tp1, _Del>&) = delete;
-
// If an exception is thrown this constructor has no effect.
template<typename _Tp1, typename _Del>
explicit __shared_ptr(std::unique_ptr<_Tp1, _Del>&& __r)
template<typename _Tp1, typename _Del>
__shared_ptr&
- operator=(const std::unique_ptr<_Tp1, _Del>& __r) = delete;
-
- template<typename _Tp1, typename _Del>
- __shared_ptr&
operator=(std::unique_ptr<_Tp1, _Del>&& __r)
{
__shared_ptr(std::move(__r)).swap(*this);
}
// Observers.
- typename std::add_lvalue_reference<element_type>::type operator*() const
+ typename std::add_lvalue_reference<element_type>::type
+ operator*() const
{
_GLIBCXX_DEBUG_ASSERT(get() != 0);
return *get();
// Disable copy from lvalue.
unique_ptr(const unique_ptr&) = delete;
-
- template<typename _Up, typename _Up_Deleter>
- unique_ptr(const unique_ptr<_Up, _Up_Deleter>&) = delete;
-
unique_ptr& operator=(const unique_ptr&) = delete;
- template<typename _Up, typename _Up_Deleter>
- unique_ptr& operator=(const unique_ptr<_Up, _Up_Deleter>&) = delete;
-
private:
__tuple_type _M_t;
};
// { dg-options "-std=gnu++0x" }
// { dg-do compile }
-// Copyright (C) 2008, 2009 Free Software Foundation
+// Copyright (C) 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
std::shared_ptr<A> a;
std::unique_ptr<A> u;
- a = u; // { dg-error "used here" }
+ a = u; // { dg-error "cannot bind" }
return 0;
}
test01();
return 0;
}
-// { dg-excess-errors "deleted function" }
+// { dg-excess-errors "initializing argument" }
// { dg-options "-std=gnu++0x" }
// { dg-do compile }
-// Copyright (C) 2008, 2009 Free Software Foundation
+// Copyright (C) 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
bool test __attribute__((unused)) = true;
std::unique_ptr<A> a;
- std::shared_ptr<A> p(a); // { dg-error "used here" }
+ std::shared_ptr<A> p(a); // { dg-error "cannot bind" }
return 0;
}
test01();
return 0;
}
-// { dg-excess-errors "deleted function" }
+// { dg-excess-errors "initializing argument" }
std::unique_ptr<int[2]> p2 = p1;
}
-// { dg-error "deleted function" "" { target *-*-* } 354 }
+// { dg-error "deleted function" "" { target *-*-* } 348 }
// { dg-error "used here" "" { target *-*-* } 42 }
// { dg-error "no matching" "" { target *-*-* } 48 }
// { dg-warning "candidates are" "" { target *-*-* } 115 }
// { dg-warning "note" "" { target *-*-* } 103 }
// { dg-warning "note" "" { target *-*-* } 98 }
// { dg-warning "note" "" { target *-*-* } 92 }
-// { dg-error "deleted function" "" { target *-*-* } 209 }
+// { dg-error "deleted function" "" { target *-*-* } 210 }
// { dg-error "used here" "" { target *-*-* } 49 }
}
// { dg-error "used here" "" { target *-*-* } 35 }
-// { dg-error "deleted function" "" { target *-*-* } 344 }
+// { dg-error "deleted function" "" { target *-*-* } 338 }