gnu/gcc.git/7738be342c3f283d00888972cafc2920134393c9 libstdc++: Do not use projection for ranges::replace default args (LWG 4444)
Implement the resolution of LWG 444, accepted in Kona 2025.
The new value to be assigned to the matching elements should default to
the value type of the range, not the type returned by the projection.
The type returned by the projection is only used to find the matching
elements, and might not be assignable to the value type at all.
libstdc++-v3/ChangeLog:
* include/bits/ranges_algo.h (__replace_fn, __replace_if_fn):
Change default template argument for type of new value, as per
LWG 4444.
* testsuite/25_algorithms/replace/lwg4444.cc: New test.
* testsuite/25_algorithms/replace_if/lwg4444.cc: New test.
Reviewed-by: Tomasz KamiĆski <tkaminsk@redhat.com>
3 files changed