Commit 68053a3
[Clang] Handle structs with inner structs and no fields (llvm#89126)
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: llvm#88931
(cherry picked from commit c32712d)1 parent 0892636 commit 68053a3
File tree
3 files changed
+75
-11
lines changed- clang
- lib/CodeGen
- test/CodeGen
3 files changed
+75
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
826 | 826 | | |
827 | 827 | | |
828 | 828 | | |
829 | | - | |
830 | | - | |
| 829 | + | |
831 | 830 | | |
832 | | - | |
833 | | - | |
834 | | - | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
835 | 836 | | |
836 | | - | |
| 837 | + | |
837 | 838 | | |
838 | 839 | | |
839 | 840 | | |
840 | | - | |
| 841 | + | |
841 | 842 | | |
842 | 843 | | |
843 | | - | |
844 | | - | |
845 | | - | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
846 | 848 | | |
847 | 849 | | |
848 | 850 | | |
849 | 851 | | |
| 852 | + | |
850 | 853 | | |
851 | | - | |
| 854 | + | |
852 | 855 | | |
853 | 856 | | |
854 | 857 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
0 commit comments