[libc++][ranges] Fix the return value of `{copy,move}_backward`.
authorKonstantin Varlamov <varconst@apple.com>
Wed, 3 Aug 2022 05:22:49 +0000 (22:22 -0700)
committerKonstantin Varlamov <varconst@apple.com>
Wed, 3 Aug 2022 05:22:59 +0000 (22:22 -0700)
commitf537a01d3989d37aafc050a92c74e69d35381f8c
tree87471208ba3b8c3d45ac097690a6970c73b6dbc0
parent760d2b462c04537d119d76d3cc37d2cb53774a05
[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
libcxx/include/__algorithm/copy_backward.h
libcxx/include/__algorithm/ranges_move_backward.h
libcxx/test/std/algorithms/alg.modifying.operations/alg.copy/ranges.copy_backward.pass.cpp
libcxx/test/std/algorithms/alg.modifying.operations/alg.move/ranges.move_backward.pass.cpp
libcxx/test/std/algorithms/ranges_robust_against_dangling.pass.cpp
libcxx/test/std/algorithms/ranges_robust_against_proxy_iterators.pass.cpp