diff --git a/libcxx/include/__config b/libcxx/include/__config --- a/libcxx/include/__config +++ b/libcxx/include/__config @@ -454,10 +454,6 @@ # endif #endif -#if !(__has_feature(cxx_rvalue_references)) -#define _LIBCPP_HAS_NO_RVALUE_REFERENCES -#endif - #if !(__has_feature(cxx_auto_type)) #define _LIBCPP_HAS_NO_AUTO_TYPE #endif @@ -1088,12 +1084,6 @@ # define _LIBCPP_INLINE_VAR #endif -#ifdef _LIBCPP_HAS_NO_RVALUE_REFERENCES -# define _LIBCPP_EXPLICIT_MOVE(x) _VSTD::move(x) -#else -# define _LIBCPP_EXPLICIT_MOVE(x) (x) -#endif - #ifndef _LIBCPP_CONSTEXPR_IF_NODEBUG #if defined(_LIBCPP_DEBUG) || defined(_LIBCPP_HAS_NO_CXX14_CONSTEXPR) #define _LIBCPP_CONSTEXPR_IF_NODEBUG diff --git a/libcxx/include/__hash_table b/libcxx/include/__hash_table --- a/libcxx/include/__hash_table +++ b/libcxx/include/__hash_table @@ -2562,7 +2562,7 @@ __h.get_deleter().__value_constructed = true; __h->__hash_ = hash_function()(__h->__value_); __h->__next_ = nullptr; - return _LIBCPP_EXPLICIT_MOVE(__h); // explicitly moved for C++03 + return __h; } template @@ -2576,7 +2576,7 @@ __h.get_deleter().__value_constructed = true; __h->__hash_ = __hash; __h->__next_ = nullptr; - return _LIBCPP_EXPLICIT_MOVE(__h); // explicitly moved for C++03 + return __h; } #endif // _LIBCPP_CXX03_LANG diff --git a/libcxx/include/__tree b/libcxx/include/__tree --- a/libcxx/include/__tree +++ b/libcxx/include/__tree @@ -2270,7 +2270,7 @@ __node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na)); __node_traits::construct(__na, _NodeTypes::__get_ptr(__h->__value_), __v); __h.get_deleter().__value_constructed = true; - return _LIBCPP_EXPLICIT_MOVE(__h); // explicitly moved for C++03 + return __h; } #endif // _LIBCPP_CXX03_LANG diff --git a/libcxx/include/ext/hash_map b/libcxx/include/ext/hash_map --- a/libcxx/include/ext/hash_map +++ b/libcxx/include/ext/hash_map @@ -671,7 +671,7 @@ __h.get_deleter().__first_constructed = true; __node_traits::construct(__na, _VSTD::addressof(__h->__value_.second)); __h.get_deleter().__second_constructed = true; - return _LIBCPP_EXPLICIT_MOVE(__h); // explicitly moved for C++03 + return __h; } template diff --git a/libcxx/include/future b/libcxx/include/future --- a/libcxx/include/future +++ b/libcxx/include/future @@ -624,18 +624,10 @@ public: template -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - void set_value(_Arg&& __arg); -#else - void set_value(_Arg& __arg); -#endif + void set_value(_Arg&& __arg); template -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - void set_value_at_thread_exit(_Arg&& __arg); -#else - void set_value_at_thread_exit(_Arg& __arg); -#endif + void set_value_at_thread_exit(_Arg&& __arg); _Rp move(); typename add_lvalue_reference<_Rp>::type copy(); @@ -654,11 +646,7 @@ template _LIBCPP_AVAILABILITY_FUTURE void -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES __assoc_state<_Rp>::set_value(_Arg&& __arg) -#else -__assoc_state<_Rp>::set_value(_Arg& __arg) -#endif { unique_lock __lk(this->__mut_); if (this->__has_value()) @@ -671,11 +659,7 @@ template template void -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES __assoc_state<_Rp>::set_value_at_thread_exit(_Arg&& __arg) -#else -__assoc_state<_Rp>::set_value_at_thread_exit(_Arg& __arg) -#endif { unique_lock __lk(this->__mut_); if (this->__has_value()) @@ -856,16 +840,12 @@ _Fp __func_; public: -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES _LIBCPP_INLINE_VISIBILITY explicit __deferred_assoc_state(_Fp&& __f); -#endif virtual void __execute(); }; -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - template inline __deferred_assoc_state<_Rp, _Fp>::__deferred_assoc_state(_Fp&& __f) @@ -874,8 +854,6 @@ this->__set_deferred(); } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES - template void __deferred_assoc_state<_Rp, _Fp>::__execute() @@ -903,16 +881,12 @@ _Fp __func_; public: -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES _LIBCPP_INLINE_VISIBILITY explicit __deferred_assoc_state(_Fp&& __f); -#endif virtual void __execute(); }; -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - template inline __deferred_assoc_state::__deferred_assoc_state(_Fp&& __f) @@ -921,8 +895,6 @@ this->__set_deferred(); } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES - template void __deferred_assoc_state::__execute() @@ -952,16 +924,12 @@ virtual void __on_zero_shared() _NOEXCEPT; public: -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES _LIBCPP_INLINE_VISIBILITY explicit __async_assoc_state(_Fp&& __f); -#endif virtual void __execute(); }; -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - template inline __async_assoc_state<_Rp, _Fp>::__async_assoc_state(_Fp&& __f) @@ -969,8 +937,6 @@ { } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES - template void __async_assoc_state<_Rp, _Fp>::__execute() @@ -1007,16 +973,12 @@ virtual void __on_zero_shared() _NOEXCEPT; public: -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES _LIBCPP_INLINE_VISIBILITY explicit __async_assoc_state(_Fp&& __f); -#endif virtual void __execute(); }; -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - template inline __async_assoc_state::__async_assoc_state(_Fp&& __f) @@ -1024,8 +986,6 @@ { } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES - template void __async_assoc_state::__execute() @@ -1062,19 +1022,11 @@ template _LIBCPP_INLINE_VISIBILITY future<_Rp> -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES __make_deferred_assoc_state(_Fp&& __f); -#else -__make_deferred_assoc_state(_Fp __f); -#endif template _LIBCPP_INLINE_VISIBILITY future<_Rp> -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES __make_async_assoc_state(_Fp&& __f); -#else -__make_async_assoc_state(_Fp __f); -#endif template class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FUTURE future @@ -1086,22 +1038,14 @@ template friend class promise; template friend class shared_future; -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES template friend future<_R1> __make_deferred_assoc_state(_Fp&& __f); template friend future<_R1> __make_async_assoc_state(_Fp&& __f); -#else - template - friend future<_R1> __make_deferred_assoc_state(_Fp __f); - template - friend future<_R1> __make_async_assoc_state(_Fp __f); -#endif public: _LIBCPP_INLINE_VISIBILITY future() _NOEXCEPT : __state_(nullptr) {} -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES _LIBCPP_INLINE_VISIBILITY future(future&& __rhs) _NOEXCEPT : __state_(__rhs.__state_) {__rhs.__state_ = nullptr;} @@ -1113,12 +1057,7 @@ future(std::move(__rhs)).swap(*this); return *this; } -#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES -private: - future(const future&); - future& operator=(const future&); -public: -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES + ~future(); _LIBCPP_INLINE_VISIBILITY shared_future<_Rp> share() _NOEXCEPT; @@ -1186,22 +1125,14 @@ template friend class promise; template friend class shared_future; -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES template friend future<_R1> __make_deferred_assoc_state(_Fp&& __f); template friend future<_R1> __make_async_assoc_state(_Fp&& __f); -#else - template - friend future<_R1> __make_deferred_assoc_state(_Fp __f); - template - friend future<_R1> __make_async_assoc_state(_Fp __f); -#endif public: _LIBCPP_INLINE_VISIBILITY future() _NOEXCEPT : __state_(nullptr) {} -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES _LIBCPP_INLINE_VISIBILITY future(future&& __rhs) _NOEXCEPT : __state_(__rhs.__state_) {__rhs.__state_ = nullptr;} @@ -1213,12 +1144,7 @@ future(std::move(__rhs)).swap(*this); return *this; } -#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES -private: - future(const future&); - future& operator=(const future&); -public: -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES + ~future(); _LIBCPP_INLINE_VISIBILITY shared_future<_Rp&> share() _NOEXCEPT; @@ -1281,22 +1207,14 @@ template friend class promise; template friend class shared_future; -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES template friend future<_R1> __make_deferred_assoc_state(_Fp&& __f); template friend future<_R1> __make_async_assoc_state(_Fp&& __f); -#else - template - friend future<_R1> __make_deferred_assoc_state(_Fp __f); - template - friend future<_R1> __make_async_assoc_state(_Fp __f); -#endif public: _LIBCPP_INLINE_VISIBILITY future() _NOEXCEPT : __state_(nullptr) {} -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES _LIBCPP_INLINE_VISIBILITY future(future&& __rhs) _NOEXCEPT : __state_(__rhs.__state_) {__rhs.__state_ = nullptr;} @@ -1308,12 +1226,7 @@ future(std::move(__rhs)).swap(*this); return *this; } -#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES -private: - future(const future&); - future& operator=(const future&); -public: -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES + ~future(); _LIBCPP_INLINE_VISIBILITY shared_future share() _NOEXCEPT; @@ -1367,20 +1280,13 @@ promise(); template promise(allocator_arg_t, const _Alloc& __a); -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES _LIBCPP_INLINE_VISIBILITY promise(promise&& __rhs) _NOEXCEPT : __state_(__rhs.__state_) {__rhs.__state_ = nullptr;} promise(const promise& __rhs) = delete; -#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES -private: - promise(const promise& __rhs); -public: -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES ~promise(); // assignment -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES _LIBCPP_INLINE_VISIBILITY promise& operator=(promise&& __rhs) _NOEXCEPT { @@ -1388,11 +1294,7 @@ return *this; } promise& operator=(const promise& __rhs) = delete; -#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES -private: - promise& operator=(const promise& __rhs); -public: -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES + _LIBCPP_INLINE_VISIBILITY void swap(promise& __rhs) _NOEXCEPT {_VSTD::swap(__state_, __rhs.__state_);} @@ -1401,16 +1303,12 @@ // setting the result void set_value(const _Rp& __r); -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES void set_value(_Rp&& __r); -#endif void set_exception(exception_ptr __p); // setting the result with deferred notification void set_value_at_thread_exit(const _Rp& __r); -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES void set_value_at_thread_exit(_Rp&& __r); -#endif void set_exception_at_thread_exit(exception_ptr __p); }; @@ -1464,8 +1362,6 @@ __state_->set_value(__r); } -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - template void promise<_Rp>::set_value(_Rp&& __r) @@ -1475,8 +1371,6 @@ __state_->set_value(_VSTD::move(__r)); } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES - template void promise<_Rp>::set_exception(exception_ptr __p) @@ -1496,8 +1390,6 @@ __state_->set_value_at_thread_exit(__r); } -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - template void promise<_Rp>::set_value_at_thread_exit(_Rp&& __r) @@ -1507,8 +1399,6 @@ __state_->set_value_at_thread_exit(_VSTD::move(__r)); } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES - template void promise<_Rp>::set_exception_at_thread_exit(exception_ptr __p) @@ -1535,20 +1425,13 @@ promise(); template promise(allocator_arg_t, const _Allocator& __a); -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES _LIBCPP_INLINE_VISIBILITY promise(promise&& __rhs) _NOEXCEPT : __state_(__rhs.__state_) {__rhs.__state_ = nullptr;} promise(const promise& __rhs) = delete; -#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES -private: - promise(const promise& __rhs); -public: -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES ~promise(); // assignment -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES _LIBCPP_INLINE_VISIBILITY promise& operator=(promise&& __rhs) _NOEXCEPT { @@ -1556,11 +1439,7 @@ return *this; } promise& operator=(const promise& __rhs) = delete; -#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES -private: - promise& operator=(const promise& __rhs); -public: -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES + _LIBCPP_INLINE_VISIBILITY void swap(promise& __rhs) _NOEXCEPT {_VSTD::swap(__state_, __rhs.__state_);} @@ -1672,20 +1551,13 @@ template _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS promise(allocator_arg_t, const _Allocator& __a); -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES _LIBCPP_INLINE_VISIBILITY promise(promise&& __rhs) _NOEXCEPT : __state_(__rhs.__state_) {__rhs.__state_ = nullptr;} promise(const promise& __rhs) = delete; -#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES -private: - promise(const promise& __rhs); -public: -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES ~promise(); // assignment -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES _LIBCPP_INLINE_VISIBILITY promise& operator=(promise&& __rhs) _NOEXCEPT { @@ -1693,11 +1565,7 @@ return *this; } promise& operator=(const promise& __rhs) = delete; -#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES -private: - promise& operator=(const promise& __rhs); -public: -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES + _LIBCPP_INLINE_VISIBILITY void swap(promise& __rhs) _NOEXCEPT {_VSTD::swap(__state_, __rhs.__state_);} @@ -2273,11 +2141,7 @@ template _LIBCPP_INLINE_VISIBILITY future<_Rp> -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES __make_deferred_assoc_state(_Fp&& __f) -#else -__make_deferred_assoc_state(_Fp __f) -#endif { unique_ptr<__deferred_assoc_state<_Rp, _Fp>, __release_shared_count> __h(new __deferred_assoc_state<_Rp, _Fp>(_VSTD::forward<_Fp>(__f))); @@ -2286,11 +2150,7 @@ template _LIBCPP_INLINE_VISIBILITY future<_Rp> -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES __make_async_assoc_state(_Fp&& __f) -#else -__make_async_assoc_state(_Fp __f) -#endif { unique_ptr<__async_assoc_state<_Rp, _Fp>, __release_shared_count> __h(new __async_assoc_state<_Rp, _Fp>(_VSTD::forward<_Fp>(__f))); @@ -2380,24 +2240,20 @@ _LIBCPP_INLINE_VISIBILITY shared_future(const shared_future& __rhs) _NOEXCEPT : __state_(__rhs.__state_) {if (__state_) __state_->__add_shared();} -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES _LIBCPP_INLINE_VISIBILITY shared_future(future<_Rp>&& __f) _NOEXCEPT : __state_(__f.__state_) {__f.__state_ = nullptr;} _LIBCPP_INLINE_VISIBILITY shared_future(shared_future&& __rhs) _NOEXCEPT : __state_(__rhs.__state_) {__rhs.__state_ = nullptr;} -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES ~shared_future(); shared_future& operator=(const shared_future& __rhs) _NOEXCEPT; -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES _LIBCPP_INLINE_VISIBILITY shared_future& operator=(shared_future&& __rhs) _NOEXCEPT { shared_future(std::move(__rhs)).swap(*this); return *this; } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES // retrieving the value _LIBCPP_INLINE_VISIBILITY @@ -2454,24 +2310,20 @@ _LIBCPP_INLINE_VISIBILITY shared_future(const shared_future& __rhs) : __state_(__rhs.__state_) {if (__state_) __state_->__add_shared();} -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES _LIBCPP_INLINE_VISIBILITY shared_future(future<_Rp&>&& __f) _NOEXCEPT : __state_(__f.__state_) {__f.__state_ = nullptr;} _LIBCPP_INLINE_VISIBILITY shared_future(shared_future&& __rhs) _NOEXCEPT : __state_(__rhs.__state_) {__rhs.__state_ = nullptr;} -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES ~shared_future(); shared_future& operator=(const shared_future& __rhs); -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES _LIBCPP_INLINE_VISIBILITY shared_future& operator=(shared_future&& __rhs) _NOEXCEPT { shared_future(std::move(__rhs)).swap(*this); return *this; } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES // retrieving the value _LIBCPP_INLINE_VISIBILITY @@ -2528,24 +2380,20 @@ _LIBCPP_INLINE_VISIBILITY shared_future(const shared_future& __rhs) : __state_(__rhs.__state_) {if (__state_) __state_->__add_shared();} -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES _LIBCPP_INLINE_VISIBILITY shared_future(future&& __f) _NOEXCEPT : __state_(__f.__state_) {__f.__state_ = nullptr;} _LIBCPP_INLINE_VISIBILITY shared_future(shared_future&& __rhs) _NOEXCEPT : __state_(__rhs.__state_) {__rhs.__state_ = nullptr;} -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES ~shared_future(); shared_future& operator=(const shared_future& __rhs); -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES _LIBCPP_INLINE_VISIBILITY shared_future& operator=(shared_future&& __rhs) _NOEXCEPT { shared_future(std::move(__rhs)).swap(*this); return *this; } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES // retrieving the value _LIBCPP_INLINE_VISIBILITY @@ -2596,8 +2444,6 @@ return shared_future<_Rp&>(_VSTD::move(*this)); } -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - inline shared_future future::share() _NOEXCEPT @@ -2605,8 +2451,6 @@ return shared_future(_VSTD::move(*this)); } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES - _LIBCPP_END_NAMESPACE_STD #endif // !_LIBCPP_HAS_NO_THREADS diff --git a/libcxx/include/map b/libcxx/include/map --- a/libcxx/include/map +++ b/libcxx/include/map @@ -1546,7 +1546,7 @@ __h.get_deleter().__first_constructed = true; __node_traits::construct(__na, _VSTD::addressof(__h->__value_.__get_value().second)); __h.get_deleter().__second_constructed = true; - return _LIBCPP_EXPLICIT_MOVE(__h); // explicitly moved for C++03 + return __h; } template diff --git a/libcxx/include/memory b/libcxx/include/memory --- a/libcxx/include/memory +++ b/libcxx/include/memory @@ -1866,7 +1866,6 @@ _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_INLINE_VISIBILITY size_type max_size() const _NOEXCEPT {return size_type(~0) / sizeof(_Tp);} -#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS) template _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_INLINE_VISIBILITY void @@ -1874,59 +1873,7 @@ { ::new((void*)__p) _Up(_VSTD::forward<_Args>(__args)...); } -#else // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS) - _LIBCPP_INLINE_VISIBILITY - void - construct(pointer __p) - { - ::new((void*) const_cast<_Tp *>(__p)) _Tp(); - } -# if defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) - template - _LIBCPP_INLINE_VISIBILITY - void - construct(pointer __p, _A0& __a0) - { - ::new((void*) const_cast<_Tp *>(__p)) _Tp(__a0); - } - template - _LIBCPP_INLINE_VISIBILITY - void - construct(pointer __p, const _A0& __a0) - { - ::new((void*) const_cast<_Tp *>(__p)) _Tp(__a0); - } -# endif // defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) - template - _LIBCPP_INLINE_VISIBILITY - void - construct(pointer __p, _A0& __a0, _A1& __a1) - { - ::new((void*) const_cast<_Tp *>(__p)) _Tp(__a0, __a1); - } - template - _LIBCPP_INLINE_VISIBILITY - void - construct(pointer __p, const _A0& __a0, _A1& __a1) - { - ::new((void*) const_cast<_Tp *>(__p)) _Tp(__a0, __a1); - } - template - _LIBCPP_INLINE_VISIBILITY - void - construct(pointer __p, _A0& __a0, const _A1& __a1) - { - ::new((void*) const_cast<_Tp *>(__p)) _Tp(__a0, __a1); - } - template - _LIBCPP_INLINE_VISIBILITY - void - construct(pointer __p, const _A0& __a0, const _A1& __a1) - { - ::new((void*) const_cast<_Tp *>(__p)) _Tp(__a0, __a1); - } -#endif // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS) _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_INLINE_VISIBILITY void destroy(pointer __p) {__p->~_Tp();} #endif }; @@ -3589,25 +3536,17 @@ shared_ptr(const shared_ptr<_Yp>& __r, typename enable_if<__compatible_with<_Yp, element_type>::value, __nat>::type = __nat()) _NOEXCEPT; -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES _LIBCPP_INLINE_VISIBILITY shared_ptr(shared_ptr&& __r) _NOEXCEPT; template _LIBCPP_INLINE_VISIBILITY shared_ptr(shared_ptr<_Yp>&& __r, typename enable_if<__compatible_with<_Yp, element_type>::value, __nat>::type = __nat()) _NOEXCEPT; -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES template explicit shared_ptr(const weak_ptr<_Yp>& __r, typename enable_if::value, __nat>::type= __nat()); #if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR) -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES template shared_ptr(auto_ptr<_Yp>&& __r, typename enable_if::value, __nat>::type = __nat()); -#else - template - shared_ptr(auto_ptr<_Yp> __r, - typename enable_if::value, __nat>::type = __nat()); -#endif #endif template shared_ptr(unique_ptr<_Yp, _Dp>&&, @@ -3640,7 +3579,6 @@ >::type _LIBCPP_INLINE_VISIBILITY operator=(const shared_ptr<_Yp>& __r) _NOEXCEPT; -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES _LIBCPP_INLINE_VISIBILITY shared_ptr& operator=(shared_ptr&& __r) _NOEXCEPT; template @@ -3661,19 +3599,6 @@ shared_ptr >::type& operator=(auto_ptr<_Yp>&& __r); -#endif -#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES -#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR) - template - _LIBCPP_INLINE_VISIBILITY - typename enable_if - < - !is_array<_Yp>::value && - is_convertible<_Yp*, element_type*>::value, - shared_ptr& - >::type - operator=(auto_ptr<_Yp> __r); -#endif #endif template typename enable_if @@ -3682,13 +3607,8 @@ is_convertible::pointer, element_type*>::value, shared_ptr& >::type -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES _LIBCPP_INLINE_VISIBILITY operator=(unique_ptr<_Yp, _Dp>&& __r); -#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES - _LIBCPP_INLINE_VISIBILITY - operator=(unique_ptr<_Yp, _Dp> __r); -#endif _LIBCPP_INLINE_VISIBILITY void swap(shared_ptr& __r) _NOEXCEPT; @@ -4004,8 +3924,6 @@ __cntrl_->__add_shared(); } -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - template inline shared_ptr<_Tp>::shared_ptr(shared_ptr&& __r) _NOEXCEPT @@ -4029,16 +3947,10 @@ __r.__cntrl_ = 0; } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES - #if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR) template template -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES shared_ptr<_Tp>::shared_ptr(auto_ptr<_Yp>&& __r, -#else -shared_ptr<_Tp>::shared_ptr(auto_ptr<_Yp> __r, -#endif typename enable_if::value, __nat>::type) : __ptr_(__r.get()) { @@ -4133,8 +4045,6 @@ return *this; } -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - template inline shared_ptr<_Tp>& @@ -4191,43 +4101,6 @@ return *this; } -#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES - -#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR) -template -template -inline _LIBCPP_INLINE_VISIBILITY -typename enable_if -< - !is_array<_Yp>::value && - is_convertible<_Yp*, typename shared_ptr<_Tp>::element_type*>::value, - shared_ptr<_Tp>& ->::type -shared_ptr<_Tp>::operator=(auto_ptr<_Yp> __r) -{ - shared_ptr(__r).swap(*this); - return *this; -} -#endif - -template -template -inline _LIBCPP_INLINE_VISIBILITY -typename enable_if -< - !is_array<_Yp>::value && - is_convertible::pointer, - typename shared_ptr<_Tp>::element_type*>::value, - shared_ptr<_Tp>& ->::type -shared_ptr<_Tp>::operator=(unique_ptr<_Yp, _Dp> __r) -{ - shared_ptr(_VSTD::move(__r)).swap(*this); - return *this; -} - -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES - template inline void @@ -4558,13 +4431,11 @@ typename enable_if::value, __nat*>::type = 0) _NOEXCEPT; -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES _LIBCPP_INLINE_VISIBILITY weak_ptr(weak_ptr&& __r) _NOEXCEPT; template _LIBCPP_INLINE_VISIBILITY weak_ptr(weak_ptr<_Yp>&& __r, typename enable_if::value, __nat*>::type = 0) _NOEXCEPT; -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES ~weak_ptr(); _LIBCPP_INLINE_VISIBILITY @@ -4578,8 +4449,6 @@ _LIBCPP_INLINE_VISIBILITY operator=(weak_ptr<_Yp> const& __r) _NOEXCEPT; -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - _LIBCPP_INLINE_VISIBILITY weak_ptr& operator=(weak_ptr&& __r) _NOEXCEPT; template @@ -4591,8 +4460,6 @@ _LIBCPP_INLINE_VISIBILITY operator=(weak_ptr<_Yp>&& __r) _NOEXCEPT; -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES - template typename enable_if < @@ -4677,8 +4544,6 @@ __cntrl_->__add_weak(); } -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - template inline weak_ptr<_Tp>::weak_ptr(weak_ptr&& __r) _NOEXCEPT @@ -4702,8 +4567,6 @@ __r.__cntrl_ = 0; } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES - template weak_ptr<_Tp>::~weak_ptr() { @@ -4734,8 +4597,6 @@ return *this; } -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - template inline weak_ptr<_Tp>& @@ -4759,8 +4620,6 @@ return *this; } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES - template template inline diff --git a/libcxx/include/unordered_map b/libcxx/include/unordered_map --- a/libcxx/include/unordered_map +++ b/libcxx/include/unordered_map @@ -1657,7 +1657,7 @@ __h.get_deleter().__first_constructed = true; __node_traits::construct(__na, _VSTD::addressof(__h->__value_.__get_value().second)); __h.get_deleter().__second_constructed = true; - return _LIBCPP_EXPLICIT_MOVE(__h); // explicitly moved for C++03 + return __h; } template diff --git a/libcxx/test/std/thread/futures/futures.promise/copy_assign.fail.cpp b/libcxx/test/std/thread/futures/futures.promise/copy_assign.verify.cpp rename from libcxx/test/std/thread/futures/futures.promise/copy_assign.fail.cpp rename to libcxx/test/std/thread/futures/futures.promise/copy_assign.verify.cpp --- a/libcxx/test/std/thread/futures/futures.promise/copy_assign.fail.cpp +++ b/libcxx/test/std/thread/futures/futures.promise/copy_assign.verify.cpp @@ -20,7 +20,6 @@ int main(int, char**) { -#if TEST_STD_VER >= 11 { std::promise p0, p; p = p0; // expected-error {{overload resolution selected deleted operator '='}} @@ -33,20 +32,6 @@ std::promise p0, p; p = p0; // expected-error {{overload resolution selected deleted operator '='}} } -#else - { - std::promise p0, p; - p = p0; // expected-error {{'operator=' is a private member of 'std::__1::promise'}} - } - { - std::promise p0, p; - p = p0; // expected-error {{'operator=' is a private member of 'std::__1::promise'}} - } - { - std::promise p0, p; - p = p0; // expected-error {{'operator=' is a private member of 'std::__1::promise'}} - } -#endif - return 0; + return 0; } diff --git a/libcxx/test/std/thread/futures/futures.promise/copy_ctor.fail.cpp b/libcxx/test/std/thread/futures/futures.promise/copy_ctor.verify.cpp rename from libcxx/test/std/thread/futures/futures.promise/copy_ctor.fail.cpp rename to libcxx/test/std/thread/futures/futures.promise/copy_ctor.verify.cpp --- a/libcxx/test/std/thread/futures/futures.promise/copy_ctor.fail.cpp +++ b/libcxx/test/std/thread/futures/futures.promise/copy_ctor.verify.cpp @@ -20,7 +20,6 @@ int main(int, char**) { -#if TEST_STD_VER >= 11 { std::promise p0; std::promise p(p0); // expected-error {{call to deleted constructor of 'std::promise'}} @@ -33,20 +32,6 @@ std::promise p0; std::promise p(p0); // expected-error {{call to deleted constructor of 'std::promise'}} } -#else - { - std::promise p0; - std::promise p(p0); // expected-error {{calling a private constructor of class 'std::__1::promise'}} - } - { - std::promise p0; - std::promise p(p0); // expected-error {{calling a private constructor of class 'std::__1::promise'}} - } - { - std::promise p0; - std::promise p(p0); // expected-error {{calling a private constructor of class 'std::__1::promise'}} - } -#endif - return 0; + return 0; } diff --git a/libcxx/test/std/thread/futures/futures.unique_future/copy_assign.fail.cpp b/libcxx/test/std/thread/futures/futures.unique_future/copy_assign.verify.cpp rename from libcxx/test/std/thread/futures/futures.unique_future/copy_assign.fail.cpp rename to libcxx/test/std/thread/futures/futures.unique_future/copy_assign.verify.cpp --- a/libcxx/test/std/thread/futures/futures.unique_future/copy_assign.fail.cpp +++ b/libcxx/test/std/thread/futures/futures.unique_future/copy_assign.verify.cpp @@ -20,7 +20,6 @@ int main(int, char**) { -#if TEST_STD_VER >= 11 { std::future f0, f; f = f0; // expected-error {{overload resolution selected deleted operator '='}} @@ -33,20 +32,6 @@ std::future f0, f; f = f0; // expected-error {{overload resolution selected deleted operator '='}} } -#else - { - std::future f0, f; - f = f0; // expected-error {{'operator=' is a private member of 'std::__1::future'}} - } - { - std::future f0, f; - f = f0; // expected-error {{'operator=' is a private member of 'std::__1::future'}} - } - { - std::future f0, f; - f = f0; // expected-error {{'operator=' is a private member of 'std::__1::future'}} - } -#endif - return 0; + return 0; } diff --git a/libcxx/test/std/thread/futures/futures.unique_future/copy_ctor.fail.cpp b/libcxx/test/std/thread/futures/futures.unique_future/copy_ctor.verify.cpp rename from libcxx/test/std/thread/futures/futures.unique_future/copy_ctor.fail.cpp rename to libcxx/test/std/thread/futures/futures.unique_future/copy_ctor.verify.cpp --- a/libcxx/test/std/thread/futures/futures.unique_future/copy_ctor.fail.cpp +++ b/libcxx/test/std/thread/futures/futures.unique_future/copy_ctor.verify.cpp @@ -20,7 +20,6 @@ int main(int, char**) { -#if TEST_STD_VER >= 11 { std::future f0; std::future f = f0; // expected-error {{call to deleted constructor of 'std::future'}} @@ -33,20 +32,6 @@ std::future f0; std::future f = f0; // expected-error {{call to deleted constructor of 'std::future'}} } -#else - { - std::future f0; - std::future f = f0; // expected-error {{calling a private constructor of class 'std::__1::future'}} - } - { - std::future f0; - std::future f = f0; // expected-error {{calling a private constructor of class 'std::__1::future'}} - } - { - std::future f0; - std::future f = f0; // expected-error {{calling a private constructor of class 'std::__1::future'}} - } -#endif - return 0; + return 0; } diff --git a/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc.compile.fail.cpp b/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc.verify.cpp rename from libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc.compile.fail.cpp rename to libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc.verify.cpp --- a/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc.compile.fail.cpp +++ b/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc.verify.cpp @@ -7,14 +7,14 @@ //===----------------------------------------------------------------------===// // -// XFAIL: c++03, c++11, c++14 + +// UNSUPPORTED: c++03, c++11, c++14 // class function // template function(allocator_arg_t, const A&); - -// This test runs in C++03, but we have deprecated using std::function in C++03. -// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS +// +// This signature was removed in C++17 #include #include @@ -23,7 +23,6 @@ int main(int, char**) { - std::function f(std::allocator_arg, std::allocator()); - - return 0; + std::function f(std::allocator_arg, std::allocator()); // expected-error {{no matching constructor for initialization of}} + return 0; } diff --git a/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_F.compile.fail.cpp b/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_F.verify.cpp rename from libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_F.compile.fail.cpp rename to libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_F.verify.cpp --- a/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_F.compile.fail.cpp +++ b/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_F.verify.cpp @@ -7,7 +7,8 @@ //===----------------------------------------------------------------------===// // -// XFAIL: c++03, c++11, c++14 + +// UNSUPPORTED: c++03, c++11, c++14 // class function @@ -15,9 +16,6 @@ // // This signature was removed in C++17 -// This test runs in C++03, but we have deprecated using std::function in C++03. -// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS - #include #include @@ -27,7 +25,6 @@ int main(int, char**) { - std::function f(std::allocator_arg, std::allocator(), foo); - - return 0; + std::function f(std::allocator_arg, std::allocator(), foo); // expected-error {{no matching constructor for initialization of}} + return 0; } diff --git a/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_function.compile.fail.cpp b/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_function.verify.cpp rename from libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_function.compile.fail.cpp rename to libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_function.verify.cpp --- a/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_function.compile.fail.cpp +++ b/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_function.verify.cpp @@ -7,7 +7,8 @@ //===----------------------------------------------------------------------===// // -// XFAIL: c++03, c++11, c++14 + +// UNSUPPORTED: c++03, c++11, c++14 // class function @@ -15,9 +16,6 @@ // // This signature was removed in C++17 -// This test runs in C++03, but we have deprecated using std::function in C++03. -// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS - #include #include @@ -27,7 +25,6 @@ { typedef std::function F; F f1; - F f2(std::allocator_arg, std::allocator(), f1); - - return 0; + F f2(std::allocator_arg, std::allocator(), f1); // expected-error {{no matching constructor for initialization of}} + return 0; } diff --git a/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_nullptr.compile.fail.cpp b/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_nullptr.verify.cpp rename from libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_nullptr.compile.fail.cpp rename to libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_nullptr.verify.cpp --- a/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_nullptr.compile.fail.cpp +++ b/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_nullptr.verify.cpp @@ -7,7 +7,8 @@ //===----------------------------------------------------------------------===// // -// XFAIL: c++03, c++11, c++14 + +// UNSUPPORTED: c++03, c++11, c++14 // class function @@ -15,9 +16,6 @@ // // This signature was removed in C++17 -// This test runs in C++03, but we have deprecated using std::function in C++03. -// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS - #include #include @@ -25,7 +23,6 @@ int main(int, char**) { - std::function f(std::allocator_arg, std::allocator(), nullptr); - - return 0; + std::function f(std::allocator_arg, std::allocator(), nullptr); // expected-error {{no matching constructor for initialization of}} + return 0; } diff --git a/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_rfunction.compile.fail.cpp b/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_rfunction.verify.cpp rename from libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_rfunction.compile.fail.cpp rename to libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_rfunction.verify.cpp --- a/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_rfunction.compile.fail.cpp +++ b/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_rfunction.verify.cpp @@ -7,7 +7,8 @@ //===----------------------------------------------------------------------===// // -// XFAIL: c++03, c++11, c++14 + +// UNSUPPORTED: c++03, c++11, c++14 // class function @@ -15,9 +16,6 @@ // // This signature was removed in C++17 -// This test runs in C++03, but we have deprecated using std::function in C++03. -// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS - #include #include #include @@ -55,10 +53,7 @@ int main(int, char**) { - { - std::function f = A(); - std::function f2(std::allocator_arg, std::allocator(), std::move(f)); - } - - return 0; + std::function f = A(); + std::function f2(std::allocator_arg, std::allocator(), std::move(f)); // expected-error {{no matching constructor for initialization of}} + return 0; } diff --git a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/auto_ptr.pass.cpp b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/auto_ptr.pass.cpp --- a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/auto_ptr.pass.cpp +++ b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/auto_ptr.pass.cpp @@ -50,16 +50,12 @@ { std::auto_ptr ptr(new A); A* raw_ptr = ptr.get(); -#if TEST_STD_VER >= 11 - std::shared_ptr p(std::move(ptr)); -#else - std::shared_ptr p(ptr); -#endif - assert(A::count == 1); - assert(B::count == 1); - assert(p.use_count() == 1); - assert(p.get() == raw_ptr); - assert(ptr.get() == 0); + std::shared_ptr p(std::move(ptr)); + assert(A::count == 1); + assert(B::count == 1); + assert(p.use_count() == 1); + assert(p.get() == raw_ptr); + assert(ptr.get() == 0); } assert(A::count == 0); assert(globalMemCounter.checkOutstandingNewEq(0)); @@ -70,27 +66,14 @@ globalMemCounter.throw_after = 0; try { -#if TEST_STD_VER >= 11 std::shared_ptr p(std::move(ptr)); -#else - std::shared_ptr p(ptr); -#endif assert(false); } catch (...) { -#if TEST_STD_VER >= 11 assert(A::count == 1); assert(B::count == 1); assert(ptr.get() == raw_ptr); - #else - // Without rvalue references, ptr got copied into - // the shared_ptr destructor and the copy was - // destroyed during unwinding. - (void) raw_ptr; // silence 'unused variable' warning - assert(A::count == 0); - assert(B::count == 0); -#endif } } assert(A::count == 0);