[libcxx-commits] [PATCH] D113364: [libc++] Adds missing forward_list merge tests.

Mark de Wever via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sun Nov 7 07:06:10 PST 2021


Mordante created this revision.
Mordante added a reviewer: Quuxplusone.
Mordante requested review of this revision.
Herald added a project: libc++.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.

During the review of D112660 <https://reviews.llvm.org/D112660> it turned out the tests for
`std::forward_list::merge` are incomplete.

Adds tests for the rvalue reference overloads. The tests are extended to
better test the Effects [forward.list.ops]/25 and Remarks
[forward.list.ops]/27 of the function:

- x is empty after the merge.
- Pointers and references to the moved elements of x now refer to those same elements but as members of *this.
- Iterators referring to the moved elements will continue to refer to their elements, but they now behave as iterators into *this, not into x.
- The algorithm is stable.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D113364

Files:
  libcxx/test/std/containers/sequences/forwardlist/forwardlist.ops/merge.pass.cpp
  libcxx/test/std/containers/sequences/forwardlist/forwardlist.ops/merge_lvalue.pass.cpp
  libcxx/test/std/containers/sequences/forwardlist/forwardlist.ops/merge_lvalue_pred.pass.cpp
  libcxx/test/std/containers/sequences/forwardlist/forwardlist.ops/merge_pred.pass.cpp
  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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D113364.385342.patch
Type: text/x-patch
Size: 17838 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20211107/6c41cbd1/attachment-0001.bin>


More information about the libcxx-commits mailing list