There is an open change in tidy that could be used to flag this:
[patch] Summary
This patch adds bugprone-unintended-adl
which flags uses of ADL that are not on the provided whitelist.
bugprone-unintended-adl
Finds usages of ADL (argument-dependent lookup), or potential ADL in the case of templates, that are not on the provided lists of allowed identifiers and namespaces. [...]
.. option:: IgnoreOverloadedOperators
If non-zero, ignores calls to overloaded operators using operator
syntax (e.g. a + b
), but not function call syntax (e.g.
operator+(a, b)
). Default is 1
.
.. option:: AllowedIdentifiers
Semicolon-separated list of names that the check ignores. Default
is
swap;make_error_code;make_error_condition;data;begin;end;rbegin;rend;crbegin;crend;size;ssize;empty
.
.. option:: AllowedNamespaces
Semicolon-separated list of namespace names (e.g. foo;bar::baz
).
If the check finds an unqualified call that resolves to a function
in a namespace in this list, the call is ignored. Default is an
empty list.
There seems to have been no activity on the patch since July 2020, though, but if this is of interest of the OP, the OP could try to resuscitate the patch.