diff options
| author | Marshall Clow <mclow.lists@gmail.com> | 2017-01-24 23:09:12 +0000 |
|---|---|---|
| committer | Marshall Clow <mclow.lists@gmail.com> | 2017-01-24 23:09:12 +0000 |
| commit | 63b560be69c0660b427efe903689f410e1f02967 (patch) | |
| tree | 0f5df4aa86b5886bb710a1465dd2f1a81e24ac8b /libcxx/include/stack | |
| parent | b10fb96541bc45aea71c8652bb1786899826f7ad (diff) | |
| download | bcm5719-llvm-63b560be69c0660b427efe903689f410e1f02967.tar.gz bcm5719-llvm-63b560be69c0660b427efe903689f410e1f02967.zip | |
Change the return type of emplace_[front|back] back to void when building with C++14 or before. Resolves PR31680.
llvm-svn: 292990
Diffstat (limited to 'libcxx/include/stack')
| -rw-r--r-- | libcxx/include/stack | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libcxx/include/stack b/libcxx/include/stack index 228864e4709..c797ea5ec6e 100644 --- a/libcxx/include/stack +++ b/libcxx/include/stack @@ -55,7 +55,7 @@ public: 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 @@ public: #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 |

