[clang] [Clang][Sema]: Allow flexible arrays in unions and alone in structs (PR #84428)

Kees Cook via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 20 08:28:26 PDT 2024


kees wrote:

Hmpf. Build failure encountered under an Assert:

```
# | Assertion failed: VarSize == CstSize && "Emitted constant has unexpected size", file C:\ws\src\clang\lib\CodeGen\CodeGenModule.cpp, line 5294
# | PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
# | Stack dump:
# | 0.	Program arguments: c:\\ws\\src\\build\\build-clang-windows\\bin\\clang.exe -cc1 -internal-isystem C:\\ws\\src\\build\\build-clang-windows\\lib\\clang\\19\\include -nostdsysteminc -triple i386-unknown-unknown -x c++ -emit-llvm -o - C:\\ws\\src\\clang\\test\\CodeGen\\flexible-array-init.cpp
# | 1.	C:\ws\src\clang\test\CodeGen\flexible-array-init.cpp:12:1: current parser token 'union'
# | 2.	C:\ws\src\clang\test\CodeGen\flexible-array-init.cpp:4:7: LLVM IR generation of declaration '_u0'
```

Is this an existing bug? i.e. it's the CodeGen test for `union { char x[]; } x = {0};` ... :P

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


More information about the cfe-commits mailing list