[libcxx-commits] [PATCH] D113502: [WIP][libc++] forward_list allow rvalues in C++03.
Mark de Wever via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Tue Nov 9 11:24:36 PST 2021
Mordante created this revision.
Mordante requested review of this revision.
Herald added a project: libc++.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.
Based on remarks by Quuxplusone during the review of D113364 <https://reviews.llvm.org/D113364>.
Tested locally this works, but I want a CI run before looking at the
other rvalues disabled in C++03.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D113502
Files:
libcxx/include/forward_list
libcxx/test/std/containers/sequences/forwardlist/forwardlist.ops/merge_rvalue.pass.cpp
libcxx/test/std/containers/sequences/forwardlist/forwardlist.ops/merge_rvalue_pred.pass.cpp
Index: libcxx/test/std/containers/sequences/forwardlist/forwardlist.ops/merge_rvalue_pred.pass.cpp
===================================================================
--- libcxx/test/std/containers/sequences/forwardlist/forwardlist.ops/merge_rvalue_pred.pass.cpp
+++ libcxx/test/std/containers/sequences/forwardlist/forwardlist.ops/merge_rvalue_pred.pass.cpp
@@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
-// UNSUPPORTED: c++03
-
// <forward_list>
// template <class Compare> void merge(forward_list&& x, Compare comp);
@@ -89,7 +87,7 @@
{ // Test with a different allocator.
typedef int T;
- typedef std::forward_list<T, min_allocator<T>> C;
+ typedef std::forward_list<T, min_allocator<T> > C;
const T t1[] = {13, 12, 7, 6, 5, 3};
const T t2[] = {15, 14, 11, 10, 9, 8, 4, 2, 1, 0};
const T t3[] = {15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0};
Index: libcxx/test/std/containers/sequences/forwardlist/forwardlist.ops/merge_rvalue.pass.cpp
===================================================================
--- libcxx/test/std/containers/sequences/forwardlist/forwardlist.ops/merge_rvalue.pass.cpp
+++ libcxx/test/std/containers/sequences/forwardlist/forwardlist.ops/merge_rvalue.pass.cpp
@@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
-// UNSUPPORTED: c++03
-
// <forward_list>
// void merge(forward_list&& x);
@@ -88,7 +86,7 @@
}
{ // Test with a different allocator.
typedef int T;
- typedef std::forward_list<T, min_allocator<T>> C;
+ typedef std::forward_list<T, min_allocator<T> > C;
const T t1[] = {3, 5, 6, 7, 12, 13};
const T t2[] = {0, 1, 2, 4, 8, 9, 10, 11, 14, 15};
const T t3[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15};
Index: libcxx/include/forward_list
===================================================================
--- libcxx/include/forward_list
+++ libcxx/include/forward_list
@@ -834,14 +834,11 @@
_LIBCPP_INLINE_VISIBILITY
__remove_return_type unique() {return unique(__equal_to<value_type>());}
template <class _BinaryPredicate> __remove_return_type unique(_BinaryPredicate __binary_pred);
-#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
void merge(forward_list&& __x) {merge(__x, __less<value_type>());}
template <class _Compare>
- _LIBCPP_INLINE_VISIBILITY
- void merge(forward_list&& __x, _Compare __comp)
- {merge(__x, _VSTD::move(__comp));}
-#endif // _LIBCPP_CXX03_LANG
+ _LIBCPP_INLINE_VISIBILITY
+ void merge(forward_list&& __x, _Compare __comp) {merge(__x, _VSTD::move(__comp));}
_LIBCPP_INLINE_VISIBILITY
void merge(forward_list& __x) {merge(__x, __less<value_type>());}
template <class _Compare> void merge(forward_list& __x, _Compare __comp);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D113502.385909.patch
Type: text/x-patch
Size: 2871 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20211109/083b845e/attachment.bin>
More information about the libcxx-commits
mailing list