================
@@ -7867,11 +7867,13 @@ void Sema::AddFunctionCandidates(const 
UnresolvedSetImpl &Fns,
       // This branch handles both standalone functions and static methods.
 
       // Slice the first argument (which is the base) when we access
-      // static method as non-static.
+      // static operator() as non-static.
----------------
timon-ul wrote:

I think I confused you now, sorry. To my understanding the original comment 
fits still to the new behaviour, basically whenever we access a static method 
as non-static we want to argument slice. Before this was checked by 
`FirstArgumentIsBase` and the idea was that this should hold true for these 
cases (quite frankly it is a bit messy, I think `FirstArgumentIsBase` is set 
whenever we have a member expr, no matter if it is static or not, but we only 
check for it in the branch where we know it to be static, which feels 
pointless, because we could have just asked if it was a static member expr 
instead? Not too sure on the logic here....). The problem we face is that 
operators are handled elsewhere and at that point we do not set 
`FirstArgumentIsBase` (and I think it also makes no sense for us to set it 
since some operator overloads might be non static? Unless they are handled 
individually, I actually do not know, you could test this out too I guess). 
This leaves us to having alternatively check for it being a static operator in 
each loop iteration. What this means though is that our changes now actually 
made this comment true (again).

https://github.com/llvm/llvm-project/pull/199192
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to