[libcxx-commits] [PATCH] D109414: [libc++] Comma-operator-proof a lot of algorithm/container code.

Arthur O'Dwyer via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Sep 7 20:11:12 PDT 2021


Quuxplusone created this revision.
Quuxplusone added reviewers: ldionne, libc++.
Quuxplusone added a project: libc++.
Quuxplusone requested review of this revision.
Herald added a subscriber: libcxx-commits.
Herald added 1 blocking reviewer(s): libc++.

Detected by evil-izing the widely used `MoveOnly` testing type.
I had to patch some tests that were themselves using its comma operator, but I think that's a worthwhile cost in order to catch more places in our headers that needed comma-proofing.

The trick here is that even `++ptr, ++ptr` can find a comma operator by ADL, if `ptr` is of type `Evil*`.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D109414

Files:
  libcxx/include/__algorithm/stable_sort.h
  libcxx/include/__hash_table
  libcxx/include/__memory/uninitialized_algorithms.h
  libcxx/include/__split_buffer
  libcxx/include/deque
  libcxx/include/list
  libcxx/include/string
  libcxx/include/vector
  libcxx/test/std/containers/sequences/deque/deque.modifiers/insert_iter_iter.pass.cpp
  libcxx/test/std/containers/sequences/deque/deque.modifiers/insert_rvalue.pass.cpp
  libcxx/test/std/containers/sequences/deque/deque.modifiers/push_back_rvalue.pass.cpp
  libcxx/test/std/containers/sequences/deque/deque.modifiers/push_front_rvalue.pass.cpp
  libcxx/test/std/containers/sequences/forwardlist/forwardlist.cons/assign_move.pass.cpp
  libcxx/test/std/containers/sequences/forwardlist/forwardlist.cons/move.pass.cpp
  libcxx/test/std/containers/sequences/forwardlist/forwardlist.cons/move_alloc.pass.cpp
  libcxx/test/support/MoveOnly.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D109414.371242.patch
Type: text/x-patch
Size: 21769 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20210908/74c09a0d/attachment-0001.bin>


More information about the libcxx-commits mailing list