[clang] [Clang] Sequence the object argument of an overloaded operator[] or operator() first (PR #215479)
Xavier Roche via cfe-commits
cfe-commits at lists.llvm.org
Tue Oct 6 23:26:31 PDT 2026
xroche wrote:
> I don't want to be intentionally incompatible with MSVC, but it seems hard to be compatible. Probably we could work out the rule with enough effort; there's a limited number of things that could reasonably be checked. I'm okay with approximating it as "cases where the callee calls a destructor for an argument", since that's what should actually matter.
[This MSVC example](https://godbolt.org/z/nM6E53jPs) shows that checking whether the called function destroys an argument gives the opposite index order from MSVC for both `CopyOnly` and `DtorOnly` :worried: Do we want that simple rule anyway, or should we investigate a closer match to MSVC's evaluation order?
Matching strictly MSVC behavior will be tough I think but :shrug:
https://github.com/llvm/llvm-project/pull/215479
More information about the cfe-commits
mailing list