[clang] [HLSL] Array by-value assignment (PR #109323)

Chris B via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 23 14:51:35 PDT 2024


https://github.com/llvm-beanz commented:

We either need to fix code generation so that we correctly handle modifications of the binary operator's lvalue, or we need to represent the binary operator in the AST as returning an rvalue.

This code should either work following C++ rules, or fail to compile following C rules:

```hlsl
export int fn() {
  int Arr[2] = {0, 1};
  int Arr2[2] = {1, 2};
  (Arr = Arr2)[0] = 6;
  return Arr[0] + Arr[1];
}
```

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


More information about the cfe-commits mailing list