libstdc++: Fix _OutputIteratorConcept checks in algorithms
authorJonathan Wakely <jwakely@redhat.com>
Fri, 24 Sep 2021 14:35:20 +0000 (15:35 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Tue, 28 Sep 2021 19:22:50 +0000 (20:22 +0100)
commit45a8cd256934be3770f7e000db7b13f10eabee9a
tree0a8d9d8b97964427159ba57c027d4821497039b8
parent82626be2d633a9802a8b08727ef51c627e37fee5
libstdc++: Fix _OutputIteratorConcept checks in algorithms

The _OutputIteratorConcept should be checked using the correct value
category. The std::move_backward and std::copy_backward algorithms
should use _OutputIteratorConcept instead of _ConvertibleConcept.

In order to use the correct value category, the concept should use a
function that returns _ValueT instead of using an lvalue data member.

Signed-off-by: Jonathan Wakely <jwakely@redhat.com>
libstdc++-v3/ChangeLog:

* include/bits/boost_concept_check.h (_OutputIteratorConcept):
Use a function to preserve value category of the type.
* include/bits/stl_algobase.h (copy, move, fill_n): Use a
reference as the second argument for _OutputIteratorConcept.
(copy_backward, move_backward): Use _OutputIteratorConcept
instead of _ConvertibleConcept.
libstdc++-v3/include/bits/boost_concept_check.h
libstdc++-v3/include/bits/stl_algobase.h