[libcxx-commits] [libcxx] 8d4860a - [libc++] Remove workarounds for missing rvalue references
Louis Dionne via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Aug 12 09:03:55 PDT 2020
Author: Louis Dionne
Date: 2020-08-12T12:02:28-04:00
New Revision: 8d4860aa9ee78f4c948b5f38a043c527d49d6a34
URL: https://github.com/llvm/llvm-project/commit/8d4860aa9ee78f4c948b5f38a043c527d49d6a34
DIFF: https://github.com/llvm/llvm-project/commit/8d4860aa9ee78f4c948b5f38a043c527d49d6a34.diff
LOG: [libc++] Remove workarounds for missing rvalue references
We don't support GCC in C++03 mode, and Clang provides rvalue references
even in C++03 mode. So there's effectively no supported compiler that
doesn't support rvalue references.
Differential Revision: https://reviews.llvm.org/D84943
Added:
libcxx/test/std/thread/futures/futures.promise/copy_assign.verify.cpp
libcxx/test/std/thread/futures/futures.promise/copy_ctor.verify.cpp
libcxx/test/std/thread/futures/futures.unique_future/copy_assign.verify.cpp
libcxx/test/std/thread/futures/futures.unique_future/copy_ctor.verify.cpp
libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc.verify.cpp
libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_F.verify.cpp
libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_function.verify.cpp
libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_nullptr.verify.cpp
libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_rfunction.verify.cpp
Modified:
libcxx/include/__config
libcxx/include/__hash_table
libcxx/include/__tree
libcxx/include/ext/hash_map
libcxx/include/future
libcxx/include/map
libcxx/include/memory
libcxx/include/unordered_map
libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/auto_ptr.pass.cpp
Removed:
libcxx/test/std/thread/futures/futures.promise/copy_assign.fail.cpp
libcxx/test/std/thread/futures/futures.promise/copy_ctor.fail.cpp
libcxx/test/std/thread/futures/futures.unique_future/copy_assign.fail.cpp
libcxx/test/std/thread/futures/futures.unique_future/copy_ctor.fail.cpp
libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc.compile.fail.cpp
libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_F.compile.fail.cpp
libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_function.compile.fail.cpp
libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_nullptr.compile.fail.cpp
libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_rfunction.compile.fail.cpp
################################################################################
diff --git a/libcxx/include/__config b/libcxx/include/__config
index 8c22323c2bab..d7b6a2acaeff 100644
--- a/libcxx/include/__config
+++ b/libcxx/include/__config
@@ -454,10 +454,6 @@ typedef __char32_t char32_t;
# 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 @@ typedef unsigned int char32_t;
# 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
index 13ff096897b4..2d051ee49c38 100644
--- a/libcxx/include/__hash_table
+++ b/libcxx/include/__hash_table
@@ -2562,7 +2562,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__construct_node(const __container_val
__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 <class _Tp, class _Hash, class _Equal, class _Alloc>
@@ -2576,7 +2576,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__construct_node_hash(size_t __hash,
__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
index cb7a1022e626..ed23d568751f 100644
--- a/libcxx/include/__tree
+++ b/libcxx/include/__tree
@@ -2270,7 +2270,7 @@ __tree<_Tp, _Compare, _Allocator>::__construct_node(const __container_value_type
__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
index 7478d7410064..2d6024cb9036 100644
--- a/libcxx/include/ext/hash_map
+++ b/libcxx/include/ext/hash_map
@@ -671,7 +671,7 @@ hash_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node(const key_type& __k)
__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 <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
diff --git a/libcxx/include/future b/libcxx/include/future
index 6d437a489cad..483266dddec4 100644
--- a/libcxx/include/future
+++ b/libcxx/include/future
@@ -624,18 +624,10 @@ protected:
public:
template <class _Arg>
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
- void set_value(_Arg&& __arg);
-#else
- void set_value(_Arg& __arg);
-#endif
+ void set_value(_Arg&& __arg);
template <class _Arg>
-#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 <class _Rp>
template <class _Arg>
_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<mutex> __lk(this->__mut_);
if (this->__has_value())
@@ -671,11 +659,7 @@ __assoc_state<_Rp>::set_value(_Arg& __arg)
template <class _Rp>
template <class _Arg>
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<mutex> __lk(this->__mut_);
if (this->__has_value())
@@ -856,16 +840,12 @@ class _LIBCPP_AVAILABILITY_FUTURE __deferred_assoc_state
_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 <class _Rp, class _Fp>
inline
__deferred_assoc_state<_Rp, _Fp>::__deferred_assoc_state(_Fp&& __f)
@@ -874,8 +854,6 @@ __deferred_assoc_state<_Rp, _Fp>::__deferred_assoc_state(_Fp&& __f)
this->__set_deferred();
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
template <class _Rp, class _Fp>
void
__deferred_assoc_state<_Rp, _Fp>::__execute()
@@ -903,16 +881,12 @@ class _LIBCPP_AVAILABILITY_FUTURE __deferred_assoc_state<void, _Fp>
_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 <class _Fp>
inline
__deferred_assoc_state<void, _Fp>::__deferred_assoc_state(_Fp&& __f)
@@ -921,8 +895,6 @@ __deferred_assoc_state<void, _Fp>::__deferred_assoc_state(_Fp&& __f)
this->__set_deferred();
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
template <class _Fp>
void
__deferred_assoc_state<void, _Fp>::__execute()
@@ -952,16 +924,12 @@ class _LIBCPP_AVAILABILITY_FUTURE __async_assoc_state
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 <class _Rp, class _Fp>
inline
__async_assoc_state<_Rp, _Fp>::__async_assoc_state(_Fp&& __f)
@@ -969,8 +937,6 @@ __async_assoc_state<_Rp, _Fp>::__async_assoc_state(_Fp&& __f)
{
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
template <class _Rp, class _Fp>
void
__async_assoc_state<_Rp, _Fp>::__execute()
@@ -1007,16 +973,12 @@ class _LIBCPP_AVAILABILITY_FUTURE __async_assoc_state<void, _Fp>
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 <class _Fp>
inline
__async_assoc_state<void, _Fp>::__async_assoc_state(_Fp&& __f)
@@ -1024,8 +986,6 @@ __async_assoc_state<void, _Fp>::__async_assoc_state(_Fp&& __f)
{
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
template <class _Fp>
void
__async_assoc_state<void, _Fp>::__execute()
@@ -1062,19 +1022,11 @@ template <class _Rp> class _LIBCPP_TEMPLATE_VIS future;
template <class _Rp, class _Fp>
_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 <class _Rp, class _Fp>
_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 _Rp>
class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FUTURE future
@@ -1086,22 +1038,14 @@ class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FUTURE future
template <class> friend class promise;
template <class> friend class shared_future;
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _R1, class _Fp>
friend future<_R1> __make_deferred_assoc_state(_Fp&& __f);
template <class _R1, class _Fp>
friend future<_R1> __make_async_assoc_state(_Fp&& __f);
-#else
- template <class _R1, class _Fp>
- friend future<_R1> __make_deferred_assoc_state(_Fp __f);
- template <class _R1, class _Fp>
- 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 @@ public:
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 @@ class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FUTURE future<_Rp&>
template <class> friend class promise;
template <class> friend class shared_future;
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _R1, class _Fp>
friend future<_R1> __make_deferred_assoc_state(_Fp&& __f);
template <class _R1, class _Fp>
friend future<_R1> __make_async_assoc_state(_Fp&& __f);
-#else
- template <class _R1, class _Fp>
- friend future<_R1> __make_deferred_assoc_state(_Fp __f);
- template <class _R1, class _Fp>
- 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 @@ public:
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 @@ class _LIBCPP_TYPE_VIS _LIBCPP_AVAILABILITY_FUTURE future<void>
template <class> friend class promise;
template <class> friend class shared_future;
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _R1, class _Fp>
friend future<_R1> __make_deferred_assoc_state(_Fp&& __f);
template <class _R1, class _Fp>
friend future<_R1> __make_async_assoc_state(_Fp&& __f);
-#else
- template <class _R1, class _Fp>
- friend future<_R1> __make_deferred_assoc_state(_Fp __f);
- template <class _R1, class _Fp>
- 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 @@ public:
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<void> share() _NOEXCEPT;
@@ -1367,20 +1280,13 @@ public:
promise();
template <class _Alloc>
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 @@ public:
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 @@ public:
// 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 @@ promise<_Rp>::set_value(const _Rp& __r)
__state_->set_value(__r);
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
template <class _Rp>
void
promise<_Rp>::set_value(_Rp&& __r)
@@ -1475,8 +1371,6 @@ promise<_Rp>::set_value(_Rp&& __r)
__state_->set_value(_VSTD::move(__r));
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
template <class _Rp>
void
promise<_Rp>::set_exception(exception_ptr __p)
@@ -1496,8 +1390,6 @@ promise<_Rp>::set_value_at_thread_exit(const _Rp& __r)
__state_->set_value_at_thread_exit(__r);
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
template <class _Rp>
void
promise<_Rp>::set_value_at_thread_exit(_Rp&& __r)
@@ -1507,8 +1399,6 @@ promise<_Rp>::set_value_at_thread_exit(_Rp&& __r)
__state_->set_value_at_thread_exit(_VSTD::move(__r));
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
template <class _Rp>
void
promise<_Rp>::set_exception_at_thread_exit(exception_ptr __p)
@@ -1535,20 +1425,13 @@ public:
promise();
template <class _Allocator>
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 @@ public:
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 @@ public:
template <class _Allocator>
_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 @@ public:
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 @@ struct _LIBCPP_TEMPLATE_VIS uses_allocator<packaged_task<_Callable>, _Alloc>
template <class _Rp, class _Fp>
_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 @@ __make_deferred_assoc_state(_Fp __f)
template <class _Rp, class _Fp>
_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 @@ public:
_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 @@ public:
_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 @@ public:
_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<void>&& __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 @@ future<_Rp&>::share() _NOEXCEPT
return shared_future<_Rp&>(_VSTD::move(*this));
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
inline
shared_future<void>
future<void>::share() _NOEXCEPT
@@ -2605,8 +2451,6 @@ future<void>::share() _NOEXCEPT
return shared_future<void>(_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
index d2b82591368b..96409f2389d9 100644
--- a/libcxx/include/map
+++ b/libcxx/include/map
@@ -1546,7 +1546,7 @@ map<_Key, _Tp, _Compare, _Allocator>::__construct_node_with_key(const key_type&
__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 <class _Key, class _Tp, class _Compare, class _Allocator>
diff --git a/libcxx/include/memory b/libcxx/include/memory
index e38e80568eb9..54176f4e3996 100644
--- a/libcxx/include/memory
+++ b/libcxx/include/memory
@@ -1866,7 +1866,6 @@ public:
_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 <class _Up, class... _Args>
_LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_INLINE_VISIBILITY
void
@@ -1874,59 +1873,7 @@ public:
{
::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 <class _A0>
- _LIBCPP_INLINE_VISIBILITY
- void
- construct(pointer __p, _A0& __a0)
- {
- ::new((void*) const_cast<_Tp *>(__p)) _Tp(__a0);
- }
- template <class _A0>
- _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 <class _A0, class _A1>
- _LIBCPP_INLINE_VISIBILITY
- void
- construct(pointer __p, _A0& __a0, _A1& __a1)
- {
- ::new((void*) const_cast<_Tp *>(__p)) _Tp(__a0, __a1);
- }
- template <class _A0, class _A1>
- _LIBCPP_INLINE_VISIBILITY
- void
- construct(pointer __p, const _A0& __a0, _A1& __a1)
- {
- ::new((void*) const_cast<_Tp *>(__p)) _Tp(__a0, __a1);
- }
- template <class _A0, class _A1>
- _LIBCPP_INLINE_VISIBILITY
- void
- construct(pointer __p, _A0& __a0, const _A1& __a1)
- {
- ::new((void*) const_cast<_Tp *>(__p)) _Tp(__a0, __a1);
- }
- template <class _A0, class _A1>
- _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 @@ public:
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<class _Yp> _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<class _Yp> explicit shared_ptr(const weak_ptr<_Yp>& __r,
typename enable_if<is_convertible<_Yp*, element_type*>::value, __nat>::type= __nat());
#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR)
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template<class _Yp>
shared_ptr(auto_ptr<_Yp>&& __r,
typename enable_if<is_convertible<_Yp*, element_type*>::value, __nat>::type = __nat());
-#else
- template<class _Yp>
- shared_ptr(auto_ptr<_Yp> __r,
- typename enable_if<is_convertible<_Yp*, element_type*>::value, __nat>::type = __nat());
-#endif
#endif
template <class _Yp, class _Dp>
shared_ptr(unique_ptr<_Yp, _Dp>&&,
@@ -3640,7 +3579,6 @@ public:
>::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<class _Yp>
@@ -3661,19 +3599,6 @@ public:
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<class _Yp>
- _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 <class _Yp, class _Dp>
typename enable_if
@@ -3682,13 +3607,8 @@ public:
is_convertible<typename unique_ptr<_Yp, _Dp>::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 @@ shared_ptr<_Tp>::shared_ptr(const shared_ptr<_Yp>& __r,
__cntrl_->__add_shared();
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
template<class _Tp>
inline
shared_ptr<_Tp>::shared_ptr(shared_ptr&& __r) _NOEXCEPT
@@ -4029,16 +3947,10 @@ shared_ptr<_Tp>::shared_ptr(shared_ptr<_Yp>&& __r,
__r.__cntrl_ = 0;
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR)
template<class _Tp>
template<class _Yp>
-#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<is_convertible<_Yp*, element_type*>::value, __nat>::type)
: __ptr_(__r.get())
{
@@ -4133,8 +4045,6 @@ shared_ptr<_Tp>::operator=(const shared_ptr<_Yp>& __r) _NOEXCEPT
return *this;
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
template<class _Tp>
inline
shared_ptr<_Tp>&
@@ -4191,43 +4101,6 @@ shared_ptr<_Tp>::operator=(unique_ptr<_Yp, _Dp>&& __r)
return *this;
}
-#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
-#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR)
-template<class _Tp>
-template<class _Yp>
-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<class _Tp>
-template <class _Yp, class _Dp>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- !is_array<_Yp>::value &&
- is_convertible<typename unique_ptr<_Yp, _Dp>::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<class _Tp>
inline
void
@@ -4558,13 +4431,11 @@ public:
typename enable_if<is_convertible<_Yp*, _Tp*>::value, __nat*>::type = 0)
_NOEXCEPT;
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
weak_ptr(weak_ptr&& __r) _NOEXCEPT;
template<class _Yp> _LIBCPP_INLINE_VISIBILITY weak_ptr(weak_ptr<_Yp>&& __r,
typename enable_if<is_convertible<_Yp*, _Tp*>::value, __nat*>::type = 0)
_NOEXCEPT;
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
~weak_ptr();
_LIBCPP_INLINE_VISIBILITY
@@ -4578,8 +4449,6 @@ public:
_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<class _Yp>
@@ -4591,8 +4460,6 @@ public:
_LIBCPP_INLINE_VISIBILITY
operator=(weak_ptr<_Yp>&& __r) _NOEXCEPT;
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
template<class _Yp>
typename enable_if
<
@@ -4677,8 +4544,6 @@ weak_ptr<_Tp>::weak_ptr(weak_ptr<_Yp> const& __r,
__cntrl_->__add_weak();
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
template<class _Tp>
inline
weak_ptr<_Tp>::weak_ptr(weak_ptr&& __r) _NOEXCEPT
@@ -4702,8 +4567,6 @@ weak_ptr<_Tp>::weak_ptr(weak_ptr<_Yp>&& __r,
__r.__cntrl_ = 0;
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
template<class _Tp>
weak_ptr<_Tp>::~weak_ptr()
{
@@ -4734,8 +4597,6 @@ weak_ptr<_Tp>::operator=(weak_ptr<_Yp> const& __r) _NOEXCEPT
return *this;
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
template<class _Tp>
inline
weak_ptr<_Tp>&
@@ -4759,8 +4620,6 @@ weak_ptr<_Tp>::operator=(weak_ptr<_Yp>&& __r) _NOEXCEPT
return *this;
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
template<class _Tp>
template<class _Yp>
inline
diff --git a/libcxx/include/unordered_map b/libcxx/include/unordered_map
index 6156cfddd7bd..f130cfffdc9c 100644
--- a/libcxx/include/unordered_map
+++ b/libcxx/include/unordered_map
@@ -1657,7 +1657,7 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node_with_key(const
__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 <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
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
similarity index 66%
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
index bf46a6847cbf..4724f58d12b3 100644
--- 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<int> p0, p;
p = p0; // expected-error {{overload resolution selected deleted operator '='}}
@@ -33,20 +32,6 @@ int main(int, char**)
std::promise<void> p0, p;
p = p0; // expected-error {{overload resolution selected deleted operator '='}}
}
-#else
- {
- std::promise<int> p0, p;
- p = p0; // expected-error {{'operator=' is a private member of 'std::__1::promise<int>'}}
- }
- {
- std::promise<int&> p0, p;
- p = p0; // expected-error {{'operator=' is a private member of 'std::__1::promise<int &>'}}
- }
- {
- std::promise<void> p0, p;
- p = p0; // expected-error {{'operator=' is a private member of 'std::__1::promise<void>'}}
- }
-#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
similarity index 65%
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
index 8f90f3da7fee..fa0f54282cdb 100644
--- 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<int> p0;
std::promise<int> p(p0); // expected-error {{call to deleted constructor of 'std::promise<int>'}}
@@ -33,20 +32,6 @@ int main(int, char**)
std::promise<void> p0;
std::promise<void> p(p0); // expected-error {{call to deleted constructor of 'std::promise<void>'}}
}
-#else
- {
- std::promise<int> p0;
- std::promise<int> p(p0); // expected-error {{calling a private constructor of class 'std::__1::promise<int>'}}
- }
- {
- std::promise<int &> p0;
- std::promise<int &> p(p0); // expected-error {{calling a private constructor of class 'std::__1::promise<int &>'}}
- }
- {
- std::promise<void> p0;
- std::promise<void> p(p0); // expected-error {{calling a private constructor of class 'std::__1::promise<void>'}}
- }
-#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
similarity index 66%
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
index 3a1a4d6be6c1..c3c2923ea1e0 100644
--- 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<int> f0, f;
f = f0; // expected-error {{overload resolution selected deleted operator '='}}
@@ -33,20 +32,6 @@ int main(int, char**)
std::future<void> f0, f;
f = f0; // expected-error {{overload resolution selected deleted operator '='}}
}
-#else
- {
- std::future<int> f0, f;
- f = f0; // expected-error {{'operator=' is a private member of 'std::__1::future<int>'}}
- }
- {
- std::future<int &> f0, f;
- f = f0; // expected-error {{'operator=' is a private member of 'std::__1::future<int &>'}}
- }
- {
- std::future<void> f0, f;
- f = f0; // expected-error {{'operator=' is a private member of 'std::__1::future<void>'}}
- }
-#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
similarity index 65%
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
index 4a8b98c1982e..56ba432e3c92 100644
--- 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<int> f0;
std::future<int> f = f0; // expected-error {{call to deleted constructor of 'std::future<int>'}}
@@ -33,20 +32,6 @@ int main(int, char**)
std::future<void> f0;
std::future<void> f = f0; // expected-error {{call to deleted constructor of 'std::future<void>'}}
}
-#else
- {
- std::future<int> f0;
- std::future<int> f = f0; // expected-error {{calling a private constructor of class 'std::__1::future<int>'}}
- }
- {
- std::future<int &> f0;
- std::future<int &> f = f0; // expected-error {{calling a private constructor of class 'std::__1::future<int &>'}}
- }
- {
- std::future<void> f0;
- std::future<void> f = f0; // expected-error {{calling a private constructor of class 'std::__1::future<void>'}}
- }
-#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
similarity index 76%
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
index 4945d3b7bf8e..49c8284b87c3 100644
--- 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 @@
//===----------------------------------------------------------------------===//
// <functional>
-// XFAIL: c++03, c++11, c++14
+
+// UNSUPPORTED: c++03, c++11, c++14
// class function<R(ArgTypes...)>
// template<class A> 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 <functional>
#include <cassert>
@@ -23,7 +23,6 @@
int main(int, char**)
{
- std::function<int(int)> f(std::allocator_arg, std::allocator<int>());
-
- return 0;
+ std::function<int(int)> f(std::allocator_arg, std::allocator<int>()); // 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
similarity index 77%
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
index 4eaaaccc2121..32405b79d5fb 100644
--- 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 @@
//===----------------------------------------------------------------------===//
// <functional>
-// XFAIL: c++03, c++11, c++14
+
+// UNSUPPORTED: c++03, c++11, c++14
// class function<R(ArgTypes...)>
@@ -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 <functional>
#include <cassert>
@@ -27,7 +25,6 @@ void foo(int) {}
int main(int, char**)
{
- std::function<void(int)> f(std::allocator_arg, std::allocator<int>(), foo);
-
- return 0;
+ std::function<void(int)> f(std::allocator_arg, std::allocator<int>(), 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
similarity index 73%
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
index e0122b5f8269..e9199cb25257 100644
--- 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 @@
//===----------------------------------------------------------------------===//
// <functional>
-// XFAIL: c++03, c++11, c++14
+
+// UNSUPPORTED: c++03, c++11, c++14
// class function<R(ArgTypes...)>
@@ -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 <functional>
#include <cassert>
@@ -27,7 +25,6 @@ int main(int, char**)
{
typedef std::function<void(int)> F;
F f1;
- F f2(std::allocator_arg, std::allocator<int>(), f1);
-
- return 0;
+ F f2(std::allocator_arg, std::allocator<int>(), 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
similarity index 76%
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
index 7d937adfe03c..6e9a6c44137f 100644
--- 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 @@
//===----------------------------------------------------------------------===//
// <functional>
-// XFAIL: c++03, c++11, c++14
+
+// UNSUPPORTED: c++03, c++11, c++14
// class function<R(ArgTypes...)>
@@ -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 <functional>
#include <cassert>
@@ -25,7 +23,6 @@
int main(int, char**)
{
- std::function<int(int)> f(std::allocator_arg, std::allocator<int>(), nullptr);
-
- return 0;
+ std::function<int(int)> f(std::allocator_arg, std::allocator<int>(), 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
similarity index 75%
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
index dfb2a6f63c31..596b74a88b8b 100644
--- 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 @@
//===----------------------------------------------------------------------===//
// <functional>
-// XFAIL: c++03, c++11, c++14
+
+// UNSUPPORTED: c++03, c++11, c++14
// class function<R(ArgTypes...)>
@@ -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 <functional>
#include <memory>
#include <cassert>
@@ -55,10 +53,7 @@ int g(int) { return 0; }
int main(int, char**)
{
- {
- std::function<int(int)> f = A();
- std::function<int(int)> f2(std::allocator_arg, std::allocator<A>(), std::move(f));
- }
-
- return 0;
+ std::function<int(int)> f = A();
+ std::function<int(int)> f2(std::allocator_arg, std::allocator<A>(), 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
index 30703b494fdb..00b1a596facb 100644
--- 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 @@ int main(int, char**)
{
std::auto_ptr<A> ptr(new A);
A* raw_ptr = ptr.get();
-#if TEST_STD_VER >= 11
- std::shared_ptr<B> p(std::move(ptr));
-#else
- std::shared_ptr<B> 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<B> 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 @@ int main(int, char**)
globalMemCounter.throw_after = 0;
try
{
-#if TEST_STD_VER >= 11
std::shared_ptr<B> p(std::move(ptr));
-#else
- std::shared_ptr<B> 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);
More information about the libcxx-commits
mailing list