apple / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies. This fork is used to manage Apple’s stable releases of Clang as well as support the Swift project.
https://llvm.org
Other
1.09k stars 320 forks source link

[Clang] Handle structs with inner structs and no fields #8926

Closed ahatanaka closed 1 week ago

ahatanaka commented 1 week ago

A struct that declares an inner struct, but no fields, won't have a field count. So getting the offset of the inner struct fails. This happens in both C and C++:

struct foo { struct bar { int Quantizermatrix[]; }; };

Here 'struct foo' has no fields.

Closes: https://github.com/llvm/llvm-project/issues/88931 (cherry picked from commit c32712d1763d74329b42c1cd68a24d4c0075b596)