[all-commits] [llvm/llvm-project] f73050: [libc++] Fix several double-moves in the code base...

Louis Dionne via All-commits all-commits at lists.llvm.org
Tue Aug 20 11:36:32 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f73050e722dd2e484358d03674eb186f3a2f4799
      https://github.com/llvm/llvm-project/commit/f73050e722dd2e484358d03674eb186f3a2f4799
  Author: Louis Dionne <ldionne.2 at gmail.com>
  Date:   2024-08-20 (Tue, 20 Aug 2024)

  Changed paths:
    M libcxx/include/__algorithm/partition.h
    M libcxx/include/__pstl/backends/default.h
    M libcxx/test/std/algorithms/alg.modifying.operations/alg.partitions/partition.pass.cpp
    M libcxx/test/std/algorithms/alg.nonmodifying/alg.contains/ranges.contains.pass.cpp
    M libcxx/test/std/algorithms/alg.nonmodifying/alg.ends_with/ranges.ends_with.pass.cpp
    M libcxx/test/std/containers/associative/from_range_associative_containers.h
    M libcxx/test/std/containers/container.adaptors/from_range_container_adaptors.h
    M libcxx/test/std/containers/sequences/from_range_sequence_containers.h
    M libcxx/test/std/containers/unord/from_range_unordered_containers.h
    M libcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.distance/iterator_sentinel.pass.cpp
    M libcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.distance/range.pass.cpp
    M libcxx/test/std/ranges/range.adaptors/range.counted/counted.pass.cpp
    M libcxx/test/std/ranges/range.adaptors/range.elements/iterator/increment.pass.cpp
    M libcxx/test/std/ranges/range.adaptors/range.split/begin.pass.cpp
    A libcxx/test/std/ranges/range.utility/range.subrange/begin_end.pass.cpp
    M libcxx/test/std/strings/basic.string/string.cons/from_range.pass.cpp
    M libcxx/test/std/utilities/format/format.range/format.range.formatter/format.functions.tests.h
    M libcxx/test/std/utilities/memory/specialized.algorithms/specialized.construct/construct_at.pass.cpp
    A libcxx/test/support/double_move_tracker.h
    M libcxx/test/support/test_iterators.h

  Log Message:
  -----------
  [libc++] Fix several double-moves in the code base (#104616)

This patch hardens the "test iterators" we use to test algorithms by
ensuring that they don't get double-moved. As a result of this
hardening, the tests started reporting multiple failures where we would
double-move iterators, which are being fixed in this patch.

In particular:
- Fixed a double-move in pstl.partition
- Add coverage for begin()/end() in subrange tests
- Fix tests for ranges::ends_with and ranges::contains, which were
  incorrectly calling begin() twice on the same subrange containing
  non-copyable input iterators.

Fixes #100709



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list