[clang] [clang] Handle templated operators with reversed arguments (PR #69595)

Shafik Yaghmour via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 25 11:12:28 PDT 2023


================
@@ -7688,7 +7688,7 @@ bool Sema::CheckNonDependentConversions(
     QualType ParamType = ParamTypes[I + Offset];
     if (!ParamType->isDependentType()) {
       unsigned ConvIdx = PO == OverloadCandidateParamOrder::Reversed
-                             ? 0
+                             ? Args.size() - 1 - (ThisConversions + I)
----------------
shafik wrote:

I think this warrants a comment as to why this computation is correct. It is certainly not obvious and if anyone ever needs to update this code it would be helpful.

https://github.com/llvm/llvm-project/pull/69595


More information about the cfe-commits mailing list