[libcxx-commits] [libcxx] b1b64db - [NFC] [libcxx] Remove shared_ptr's no-rvalue unique_ptr converting constructor.
via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Jun 8 09:49:33 PDT 2020
Author: zoecarver
Date: 2020-06-08T09:49:21-07:00
New Revision: b1b64dbef1e2bd46953c5bc77a15e6b4d7e97563
URL: https://github.com/llvm/llvm-project/commit/b1b64dbef1e2bd46953c5bc77a15e6b4d7e97563
DIFF: https://github.com/llvm/llvm-project/commit/b1b64dbef1e2bd46953c5bc77a15e6b4d7e97563.diff
LOG: [NFC] [libcxx] Remove shared_ptr's no-rvalue unique_ptr converting constructor.
All compilers supported by libc++ have rvalues in C++03 mode so, there is no need for this non-rvalue overload.
Differential Revision: https://reviews.llvm.org/D80881
Added:
Modified:
libcxx/include/memory
libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/unique_ptr.pass.cpp
Removed:
################################################################################
diff --git a/libcxx/include/memory b/libcxx/include/memory
index b1abfacca0ba..1f9f36c5bbbb 100644
--- a/libcxx/include/memory
+++ b/libcxx/include/memory
@@ -3597,7 +3597,6 @@ public:
typename enable_if<is_convertible<_Yp*, element_type*>::value, __nat>::type = __nat());
#endif
#endif
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _Yp, class _Dp>
shared_ptr(unique_ptr<_Yp, _Dp>&&,
typename enable_if
@@ -3616,26 +3615,6 @@ public:
is_convertible<typename unique_ptr<_Yp, _Dp>::pointer, element_type*>::value,
__nat
>::type = __nat());
-#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
- template <class _Yp, class _Dp>
- shared_ptr(unique_ptr<_Yp, _Dp>,
- typename enable_if
- <
- !is_lvalue_reference<_Dp>::value &&
- !is_array<_Yp>::value &&
- is_convertible<typename unique_ptr<_Yp, _Dp>::pointer, element_type*>::value,
- __nat
- >::type = __nat());
- template <class _Yp, class _Dp>
- shared_ptr(unique_ptr<_Yp, _Dp>,
- typename enable_if
- <
- is_lvalue_reference<_Dp>::value &&
- !is_array<_Yp>::value &&
- is_convertible<typename unique_ptr<_Yp, _Dp>::pointer, element_type*>::value,
- __nat
- >::type = __nat());
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
~shared_ptr();
@@ -4060,11 +4039,7 @@ shared_ptr<_Tp>::shared_ptr(auto_ptr<_Yp> __r,
template<class _Tp>
template <class _Yp, class _Dp>
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
shared_ptr<_Tp>::shared_ptr(unique_ptr<_Yp, _Dp>&& __r,
-#else
-shared_ptr<_Tp>::shared_ptr(unique_ptr<_Yp, _Dp> __r,
-#endif
typename enable_if
<
!is_lvalue_reference<_Dp>::value &&
@@ -4090,11 +4065,7 @@ shared_ptr<_Tp>::shared_ptr(unique_ptr<_Yp, _Dp> __r,
template<class _Tp>
template <class _Yp, class _Dp>
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
shared_ptr<_Tp>::shared_ptr(unique_ptr<_Yp, _Dp>&& __r,
-#else
-shared_ptr<_Tp>::shared_ptr(unique_ptr<_Yp, _Dp> __r,
-#endif
typename enable_if
<
is_lvalue_reference<_Dp>::value &&
diff --git a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/unique_ptr.pass.cpp b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/unique_ptr.pass.cpp
index 40b68f6a896b..3cbaf5e1edf6 100644
--- a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/unique_ptr.pass.cpp
+++ b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/unique_ptr.pass.cpp
@@ -94,16 +94,9 @@ int main(int, char**)
}
catch (...)
{
-#if TEST_STD_VER >= 11
assert(A::count == 1);
assert(B::count == 1);
assert(ptr.get() == raw_ptr);
-#else
- (void) raw_ptr; // silence 'unused variable' warning
- assert(A::count == 0);
- assert(B::count == 0);
- assert(ptr.get() == 0);
-#endif // TEST_STD_VER >= 11
}
}
#endif
More information about the libcxx-commits
mailing list