-
- Downloads
libstdc++: Fix ranges::copy_backward for a single memcpyable element [PR117121]
The result iterator needs to be decremented before writing to it. Improve the PR 108846 tests for all of std::copy, std::copy_n, std::copy_backward, and the std::ranges versions. libstdc++-v3/ChangeLog: PR libstdc++/117121 * include/bits/ranges_algobase.h (copy_backward): Decrement output iterator before assigning one element through it. * testsuite/25_algorithms/copy/108846.cc: Ensure the algorithm's effects are correct for a single memcpyable element. * testsuite/25_algorithms/copy_backward/108846.cc: Likewise. * testsuite/25_algorithms/copy_n/108846.cc: Likewise.
Showing
- libstdc++-v3/include/bits/ranges_algobase.h 3 additions, 2 deletionslibstdc++-v3/include/bits/ranges_algobase.h
- libstdc++-v3/testsuite/25_algorithms/copy/108846.cc 15 additions, 0 deletionslibstdc++-v3/testsuite/25_algorithms/copy/108846.cc
- libstdc++-v3/testsuite/25_algorithms/copy_backward/108846.cc 15 additions, 0 deletionslibstdc++-v3/testsuite/25_algorithms/copy_backward/108846.cc
- libstdc++-v3/testsuite/25_algorithms/copy_n/108846.cc 15 additions, 0 deletionslibstdc++-v3/testsuite/25_algorithms/copy_n/108846.cc
Loading
Please register or sign in to comment