[clang] [clang][CFG] Sequence RHS before LHS for overloaded assignment operators in CFG to match C++17 rules (PR #181113)
Utkarsh Saxena via cfe-commits
cfe-commits at lists.llvm.org
Fri Feb 13 04:35:09 PST 2026
================
@@ -5095,6 +5109,18 @@ CFGBlock *CFGBuilder::VisitForTemporaryDtors(Stmt *E, bool ExternallyDestructed,
ExternallyDestructed,
Context);
+ case Stmt::CXXOperatorCallExprClass: {
----------------
usx95 wrote:
Maybe move this to also `VisitCXXOperatorCallExprClassForTemporaryDtors`
Also add a comment to that function similar to `VisitBinaryOperatorForTemporaryDtors`
```
// For assignment operators, the RHS expression is evaluated before the LHS
// expression, so prepend temporary destructors for the RHS first.
```
https://github.com/llvm/llvm-project/pull/181113
More information about the cfe-commits
mailing list