================
@@ -844,7 +847,18 @@ const FieldDecl 
*CodeGenFunction::FindFlexibleArrayMemberField(
       if (const FieldDecl *Field =
----------------
efriedma-quic wrote:

>  if there's an inner struct that's not accessible, that doesn't affect the 
> offsets of fields outside of that inner struct.

Yes, the only thing that's relevant to offsets in a struct is the fields.  A 
struct declaration inside another struct declaration has exactly the same 
semantics as a struct definition anywhere else (unless it's an anonymous 
struct/union).

----

Maybe also try the following testcase.

```
struct foo {
  int x,y,z;
  struct bar {
    int count;
    int array[] __attribute__((counted_by(count)));
  };
};
void init(void * __attribute__((pass_dynamic_object_size(0))));
void test1(struct bar *p) {
  init(p->array);
}
```

https://github.com/llvm/llvm-project/pull/89126
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to