[clang] [Clang] Generate the GEP instead of adding AST nodes (PR #73730)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 29 11:02:51 PST 2023


AaronBallman wrote:

> @AaronBallman It's not letting me comment on your comment. While a compound literal doesn't have a DRE, it's also not a flexible array, so it's not supposed to get this far. Note that this method should only be executed if the flexible array member exists and has the `counted_by` attribute.

Sorry, I was being lazy with my examples and leaving stuff off.

```
struct S {
  int x, y;
  int blah[] __counted_by(x);
};

int main() {
  (struct S){ 1, 2 }.blah[0]; // incorrect code
}
```


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


More information about the cfe-commits mailing list