https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120386
--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jonathan Wakely <r...@gcc.gnu.org>: https://gcc.gnu.org/g:1bb7a195e7cf95537534a42e7aa8705cc78eba4e commit r16-849-g1bb7a195e7cf95537534a42e7aa8705cc78eba4e Author: Jonathan Wakely <jwak...@redhat.com> Date: Wed May 21 16:57:59 2025 +0100 libstdc++: Fix concept checks for std::unique_copy [PR120384] This looks to have been wrong since r0-125454-gea89b2482f97aa which introduced the predefined_ops.h. Since that change, the binary predicate passed to std::__unique_copy is _Iter_comp_iter, which takes arguments of the iterator type, not the iterator's value type. This removes the checks from the __unique_copy overloads and moves them into the second overload of std::unique_copy, where we have the original binary predicate, not the adapted one from predefined_ops.h. The third __unique_copy overload currently checks that the predicate is callable with the input range value type and the output range value type. This change alters that, so that we only ever check that the predicate can be called with two arguments of the same type. That is intentional, because calling the predicate with different types is a bug that will be fixed in a later commit (see PR libstdc++/120386). libstdc++-v3/ChangeLog: PR libstdc++/120384 * include/bits/stl_algo.h (__unique_copy): Remove all _BinaryPredicateConcept concept checks. (unique_copy): Check _BinaryPredicateConcept in overload that takes a predicate. * testsuite/25_algorithms/unique_copy/120384.cc: New test. Reviewed-by: Tomasz KamiÅski <tkami...@redhat.com>