[clang] [X86] Fix CodeGen crash for arrays of empty structs and unions (PR #224203)

via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 17 00:55:56 PDT 2026


hstk30-hw wrote:

C99 not allow empty struct.
6.7.2.1 p7

> If the struct-declaration-list contains no named members, the behavior is undefined

GNU extersion is allow. https://godbolt.org/z/Mx7s9Eh3G

IMO, It's just a defensive code to guard against division by zero.

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


More information about the cfe-commits mailing list