libstdc++: Fix char_traits move with overlap
authorPaul Keir <paul.keir@uws.ac.uk>
Mon, 15 Jun 2020 13:31:26 +0000 (14:31 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Mon, 15 Jun 2020 13:31:26 +0000 (14:31 +0100)
commiteb11134d0c4e4db623aefe433c9613632ef8618e
treec1ea1f74218954d572521a5203bcda7f7a741dce
parente46dad5d8f09cd344911e2df428a9d38981c2351
libstdc++: Fix char_traits move with overlap

Upon constexpr evaluation, char_traits move uses copy_backward, but its
last argument should be to the range end rather than its beginning.

2020-06-12  Paul Keir  <paul.keir@uws.ac.uk>

* include/bits/char_traits.h (char_traits::move): constexpr move with
overlap was using copy_backward incorrectly.
* testsuite/21_strings/char_traits/requirements/constexpr_functions_c++20.cc:
New test.
libstdc++-v3/include/bits/char_traits.h
libstdc++-v3/testsuite/21_strings/char_traits/requirements/constexpr_functions_c++20.cc [new file with mode: 0644]