Previously Clang was not considering operator declarations that occur at function scope. This is incorrect according to [over.match.oper]p3
The set of non-member candidates is the result of the unqualified lookup of operator@ in the context of the expression according to the usual rules for name lookup in unqualified function calls.
This patch changes operator name lookup to consider block scope declarations.
This patch fixes PR27027.
This isn't right; IDNS_LocalExtern finds local extern declarations in the namespace scope enclosing their declaration, so this will incorrectly allow:
As far as I can see, the problem is that the constructor of FindLocalExternScope only enables finding local extern declarations if we're also looking for IDNS_Ordinary; the right fix would presumably be for it to also check for IDNS_NonMemberOperator.