https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106644
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> --- As for implementation, I'd say in call.cc (add_candidates) we could do something like: if ((flags & (LOOKUP_REWRITTEN | LOOKUP_REVERSE)) && DECL_OVERLOADED_OPERATOR_IS (fn, EQ_EXPR)) { } before the loop on the overloads and depending on whether fn is in class scope or namespace scope perform lookup (again argument dependent or not?) for ovl_op_identifier (false, NE_EXPR) in the same scope. But am not really sure what to do next if this finds something (supposedly in the loop over the overloads?); I suppose if no template is involved, compare the argument types (what else?), but for templates it is unclear (to me) if it should try to instantiate them and compare types only afterwards, or what exactly should be checked whether they correspond ([basic.scope.scope]). Because e.g. http://eel.is/c++draft/basic.scope.scope#4.3.1 talks about equivalent trailing requires clauses etc.