[clang] [Clang] Forward incoming Indirect parameters across musttail calls (PR #199351)

Eli Friedman via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 5 13:51:17 PDT 2026


================
@@ -5232,6 +5232,26 @@ void CodeGenFunction::EmitWritebacks(const CallArgList &args) {
     emitWriteback(*this, I);
 }
 
+/// Whether emitting this glvalue neither has side effects nor reads mutable
+/// state, so deferring its byte read to the call boundary is equivalent to
+/// initializing the argument last, a sequencing C++17 [expr.call]/8 allows.
----------------
efriedma-quic wrote:

I think this might be applying the [expr.call] rule too widely.  For example:

```
struct A {
  int x, y[10];
};
A operator<<(A a, A b);
A f(A a, A b) { [[clang::musttail]] return a << A{a.x = 10}; }
```

The evaluation of the LHS of the shift operator is sequenced before the evaluation of the RHS.


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


More information about the cfe-commits mailing list