<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/149111>149111</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [clang][x86-64] Assertion failure in InitListExpr::getInit (“Initializer access out of range!”)
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          BKUS21
      </td>
    </tr>
</table>

<pre>
    Compiler Explorer: https://godbolt.org/z/qrsYGreMr

Generated by fuzzer.

Console output:

```
<source>:1:5: error: expected identifier or '('
    1 | int {
      |     ^
<source>:5:3: error: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]
    5 | } yv7 = {
      |   ^
      |   int
<source>:6:5: warning: too many braces around scalar initializer [-Wmany-braces-around-scalar-init]
    6 |     {},
      |     ^~
clang-22: /root/llvm-project/llvm/tools/clang/include/clang/AST/Expr.h:5287: clang::Expr* clang::InitListExpr::getInit(unsigned int): Assertion `Init < getNumInits() && "Initializer access out of range!"' failed.
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: /opt/compiler-explorer/clang-assertions-trunk-20250716/bin/clang-22 -cc1 -triple x86_64-unknown-linux-gnu -O2 -emit-obj -dumpdir /app/output.s- -disable-free -clear-ast-before-backend -main-file-name example.c -mrelocation-model pic -pic-level 2 -pic-is-pie -mframe-pointer=none -fmath-errno -ffp-contract=on -fno-rounding-math -fno-verbose-asm -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debug-info-kind=constructor -dwarf-version=4 -debugger-tuning=gdb -fdebug-compilation-dir=/app -fcoverage-compilation-dir=/app -resource-dir /opt/compiler-explorer/clang-assertions-trunk-20250716/lib/clang/22 -internal-isystem /opt/compiler-explorer/clang-assertions-trunk-20250716/lib/clang/22/include -internal-isystem /usr/local/include -internal-isystem /opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/16.0.0/../../../../x86_64-linux-gnu/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -ferror-limit 19 -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -fcolor-diagnostics -vectorize-loops -vectorize-slp -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /tmp/example-80ad5a.o -x c <source>
1.      <source>:8:2: current parser token ';'
 #0 0x0000000003fb2168 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk-20250716/bin/clang-22+0x3fb2168)
 #1 0x0000000003faf014 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
 #2 0x000075dd03e42520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #3 0x000075dd03e969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
 #4 0x000075dd03e42476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
 #5 0x000075dd03e287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
 #6 0x000075dd03e2871b (/lib/x86_64-linux-gnu/libc.so.6+0x2871b)
 #7 0x000075dd03e39e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
 #8 0x0000000006cdb5b7 clang::InitListExpr::getInit(unsigned int) (/opt/compiler-explorer/clang-assertions-trunk-20250716/bin/clang-22+0x6cdb5b7)
 #9 0x0000000006cef0b5 (anonymous namespace)::InitListChecker::CheckExplicitInitList(clang::InitializedEntity const&, clang::InitListExpr*, clang::QualType&, clang::InitListExpr*, bool) (.constprop.0) SemaInit.cpp:0:0
#10 0x0000000006cef377 (anonymous namespace)::InitListChecker::InitListChecker(clang::Sema&, clang::InitializedEntity const&, clang::InitListExpr*, clang::QualType&, bool, bool, bool, llvm::SmallVectorImpl<clang::QualType>*) SemaInit.cpp:0:0
#11 0x0000000006cf8e7b clang::InitializationSequence::Perform(clang::Sema&, clang::InitializedEntity const&, clang::InitializationKind const&, llvm::MutableArrayRef<clang::Expr*>, clang::QualType*) (/opt/compiler-explorer/clang-assertions-trunk-20250716/bin/clang-22+0x6cf8e7b)
#12 0x0000000006a2f4d5 clang::Sema::AddInitializerToDecl(clang::Decl*, clang::Expr*, bool) (/opt/compiler-explorer/clang-assertions-trunk-20250716/bin/clang-22+0x6a2f4d5)
#13 0x00000000066953da clang::Parser::ParseDeclarationAfterDeclaratorAndAttributes(clang::Declarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::ForRangeInit*) (/opt/compiler-explorer/clang-assertions-trunk-20250716/bin/clang-22+0x66953da)
#14 0x00000000066a3c39 clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, clang::DeclaratorContext, clang::ParsedAttributes&, clang::Parser::ParsedTemplateInfo&, clang::SourceLocation*, clang::Parser::ForRangeInit*) (/opt/compiler-explorer/clang-assertions-trunk-20250716/bin/clang-22+0x66a3c39)
#15 0x000000000666167e clang::Parser::ParseDeclOrFunctionDefInternal(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec&, clang::AccessSpecifier) (/opt/compiler-explorer/clang-assertions-trunk-20250716/bin/clang-22+0x666167e)
#16 0x0000000006661e19 clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*, clang::AccessSpecifier) (/opt/compiler-explorer/clang-assertions-trunk-20250716/bin/clang-22+0x6661e19)
#17 0x0000000006669aaa clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*) (/opt/compiler-explorer/clang-assertions-trunk-20250716/bin/clang-22+0x6669aaa)
#18 0x000000000666aa45 clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) (/opt/compiler-explorer/clang-assertions-trunk-20250716/bin/clang-22+0x666aa45)
#19 0x000000000665c81a clang::ParseAST(clang::Sema&, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk-20250716/bin/clang-22+0x665c81a)
#20 0x0000000004967388 clang::CodeGenAction::ExecuteAction() (/opt/compiler-explorer/clang-assertions-trunk-20250716/bin/clang-22+0x4967388)
#21 0x0000000004c5ad75 clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-assertions-trunk-20250716/bin/clang-22+0x4c5ad75)
#22 0x0000000004bd782e clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/compiler-explorer/clang-assertions-trunk-20250716/bin/clang-22+0x4bd782e)
#23 0x0000000004d4e821 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-assertions-trunk-20250716/bin/clang-22+0x4d4e821)
#24 0x0000000000d933bf cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/compiler-explorer/clang-assertions-trunk-20250716/bin/clang-22+0xd933bf)
#25 0x0000000000d89f9a ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) driver.cpp:0:0
#26 0x0000000000d8e6b9 clang_main(int, char**, llvm::ToolContext const&) (/opt/compiler-explorer/clang-assertions-trunk-20250716/bin/clang-22+0xd8e6b9)
#27 0x0000000000c44414 main (/opt/compiler-explorer/clang-assertions-trunk-20250716/bin/clang-22+0xc44414)
#28 0x000075dd03e29d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#29 0x000075dd03e29e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#30 0x0000000000d89a45 _start (/opt/compiler-explorer/clang-assertions-trunk-20250716/bin/clang-22+0xd89a45)
clang: error: unable to execute command: Aborted (core dumped)
clang: error: clang frontend command failed due to signal (use -v to see invocation)
Compiler returned: 254
```

Code: 

```c
int {
  float lv7[0];
  char mv7 : 6;
char mv7_1;
} yv7 = {
    {},
    52,
};
```
</pre>
<img width="1" height="1" alt="" src="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