[Bug libstdc++/125981] std::find_if/std::mismatch dereference the past-the-end iterator when the predicate result type has an ADL-reachable operator&&

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Jun 26 14:40:01 GMT 2026


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125981

--- Comment #9 from Jonathan Wakely <redi at gcc dot gnu.org> ---
To be more specific ...

(In reply to Ян Чуркин from comment #7)
> The point is that the
> predicate result type in this PR does model boolean-testable.

No it doesn't.

> logic_t is convertible to bool and !logic_t is too, so it models the concept.

No, that's not correct. It satisfies the syntactic parts of the concept. To
model the concept it must also meet the semantic requirements.

Your predicate does not model the concept.


More information about the Gcc-bugs mailing list