[clang] [Clang] Handle structs with inner structs and no fields (PR #89126)

Bill Wendling via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 18 14:17:25 PDT 2024


bwendling wrote:

> We should probably apply the same fix to CountCountedByAttrs.
> 
> Along those lines, we should be able to handle:
> 
> ```
> struct bar {
>   int count;
>   int array[] __attribute__((counted_by(count)));
> };
> struct foo { struct bar x; };
> void init(void * __attribute__((pass_dynamic_object_size(0))));
> void test1(struct foo *p) {
>   init(p);
> }
> ```

I can support that. I'll add it as a testcase.

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


More information about the cfe-commits mailing list