https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113851
Bug ID: 113851 Summary: boyer_moore_searcher and boyer_moore_horspool_searcher fail to accept ADL-incompatible element types Product: gcc Version: 14.0 Status: UNCONFIRMED Keywords: rejects-valid Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: de34 at live dot cn Target Milestone: --- The following program doesn't compile with libc++ due to ADL which attempts to complete a bad type. ``` #include <algorithm> #include <functional> template <class T> struct holder { T t; }; struct incomplete; int main() { using validator = holder<incomplete>*; validator varr[1]{}; (void) std::search(varr, varr + 1, std::boyer_moore_searcher<const validator*>{varr, varr + 1}); (void) std::search(varr, varr + 1, std::boyer_moore_horspool_searcher<const validator*>{varr, varr + 1}); } ``` It seems that non-ADL-proof iterator operations are problematic, and all standard library implementations suffer from similar problems (https://godbolt.org/z/Ta6PafcnK).