* include/experimental/bits/shared_ptr.h (shared_ptr(shared_ptr&&)):
Remove const from parameter.
(operator<(const shared_ptr<T>&, nullptr_t)): Use correct
specialization of std::less.
* testsuite/experimental/memory/shared_ptr/comparison/comparison.cc:
Test comparison with nullptr and actually call test functions.
From-SVN: r241310
2016-10-18 Jonathan Wakely <jwakely@redhat.com>
+ * include/experimental/bits/shared_ptr.h (shared_ptr(shared_ptr&&)):
+ Remove const from parameter.
+ (operator<(const shared_ptr<T>&, nullptr_t)): Use correct
+ specialization of std::less.
+ * testsuite/experimental/memory/shared_ptr/comparison/comparison.cc:
+ Test comparison with nullptr and actually call test functions.
+
* include/bits/uses_allocator.h (__is_uses_allocator_constructible_v)
(__is_nothrow_uses_allocator_constructible_v): Only define for C++14
and later.
shared_ptr(const shared_ptr<_Tp1>& __r) noexcept
: _Base_type(__r) { }
- shared_ptr(const shared_ptr<_Tp>&& __r) noexcept
+ shared_ptr(shared_ptr&& __r) noexcept
: _Base_type(std::move(__r)) { }
template<typename _Tp1, typename = _Compatible<_Tp1>>
operator<(const shared_ptr<_Tp>& __a, nullptr_t) noexcept
{
using __elem_t = typename shared_ptr<_Tp>::element_type;
- return std::less<__elem_t>()(__a.get(), nullptr);
+ return std::less<__elem_t*>()(__a.get(), nullptr);
}
template<typename _Tp>
return 0;
}
+void
+test03()
+{
+ std::experimental::shared_ptr<A[5]> a(new A[5]);
+ VERIFY( nullptr < a );
+}
+
int
main()
{
+ test01();
+ test02();
+ test03();
return 0;
}