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

Bill Wendling via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 29 11:08:05 PST 2023


bwendling 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
> }
> ```

Ah! I see what you mean now. I'll make sure we can catch this.

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


More information about the cfe-commits mailing list