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
diff --git a/include/stack b/include/stack
index 228864e..c797ea5 100644
--- a/include/stack
+++ b/include/stack
@@ -55,7 +55,7 @@
void push(const value_type& x);
void push(value_type&& x);
- template <class... Args> reference emplace(Args&&... args);
+ template <class... Args> reference emplace(Args&&... args); // reference in C++17
void pop();
void swap(stack& c) noexcept(is_nothrow_swappable_v<Container>)
@@ -199,8 +199,13 @@
#ifndef _LIBCPP_HAS_NO_VARIADICS
template <class... _Args>
_LIBCPP_INLINE_VISIBILITY
+#if _LIBCPP_STD_VER > 14
reference emplace(_Args&&... __args)
{ return c.emplace_back(_VSTD::forward<_Args>(__args)...);}
+#else
+ void emplace(_Args&&... __args)
+ { c.emplace_back(_VSTD::forward<_Args>(__args)...);}
+#endif
#endif // _LIBCPP_HAS_NO_VARIADICS
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY