[all-commits] [llvm/llvm-project] f537a0: [libc++][ranges] Fix the return value of `{copy, mo...

Konstantin Varlamov via All-commits all-commits at lists.llvm.org
Tue Aug 2 22:24:49 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f537a01d3989d37aafc050a92c74e69d35381f8c
      https://github.com/llvm/llvm-project/commit/f537a01d3989d37aafc050a92c74e69d35381f8c
  Author: Konstantin Varlamov <varconst at apple.com>
  Date:   2022-08-02 (Tue, 02 Aug 2022)

  Changed paths:
    M libcxx/include/__algorithm/copy_backward.h
    M libcxx/include/__algorithm/ranges_move_backward.h
    M libcxx/test/std/algorithms/alg.modifying.operations/alg.copy/ranges.copy_backward.pass.cpp
    M libcxx/test/std/algorithms/alg.modifying.operations/alg.move/ranges.move_backward.pass.cpp
    M libcxx/test/std/algorithms/ranges_robust_against_dangling.pass.cpp
    M libcxx/test/std/algorithms/ranges_robust_against_proxy_iterators.pass.cpp

  Log Message:
  -----------
  [libc++][ranges] Fix the return value of `{copy,move}_backward`.

The return value for both of these algorithms is specified as
```
`{last, result - N}` for the overloads in namespace `ranges`.
```
But the current implementation instead returns `{first, result - N}`.

Also add both algorithms to the relevant "robust" tests.

Differential Revision: https://reviews.llvm.org/D130968




More information about the All-commits mailing list