Change the return type of emplace_[front|back] back to void when building with C++14 or before. Resolves PR31680.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292990 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -87,7 +87,7 @@ public:
|
||||
reference front();
|
||||
const_reference front() const;
|
||||
|
||||
template <class... Args> reference emplace_front(Args&&... args);
|
||||
template <class... Args> reference emplace_front(Args&&... args); // reference in C++17
|
||||
void push_front(const value_type& v);
|
||||
void push_front(value_type&& v);
|
||||
|
||||
@@ -747,7 +747,11 @@ public:
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
#if _LIBCPP_STD_VER > 14
|
||||
template <class... _Args> reference emplace_front(_Args&&... __args);
|
||||
#else
|
||||
template <class... _Args> void emplace_front(_Args&&... __args);
|
||||
#endif
|
||||
#endif
|
||||
void push_front(value_type&& __v);
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
@@ -1103,7 +1107,11 @@ forward_list<_Tp, _Alloc>::assign(initializer_list<value_type> __il)
|
||||
|
||||
template <class _Tp, class _Alloc>
|
||||
template <class... _Args>
|
||||
#if _LIBCPP_STD_VER > 14
|
||||
typename forward_list<_Tp, _Alloc>::reference
|
||||
#else
|
||||
void
|
||||
#endif
|
||||
forward_list<_Tp, _Alloc>::emplace_front(_Args&&... __args)
|
||||
{
|
||||
__node_allocator& __a = base::__alloc();
|
||||
@@ -1113,7 +1121,9 @@ forward_list<_Tp, _Alloc>::emplace_front(_Args&&... __args)
|
||||
_VSTD::forward<_Args>(__args)...);
|
||||
__h->__next_ = base::__before_begin()->__next_;
|
||||
base::__before_begin()->__next_ = __h.release();
|
||||
#if _LIBCPP_STD_VER > 14
|
||||
return base::__before_begin()->__next_->__value_;
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
Reference in New Issue
Block a user