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

    <tr>
        <th>Summary</th>
        <td>
            [clang] crash at clang::Sema::ActOnDecompositionDeclarator(clang::Scope*, clang::Declarator&, llvm::MutableArrayRef<clang::TemplateParameterList*>)
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            c++20,
            clang:frontend,
            crash-on-invalid,
            clang:frontend:fuzzer
      </td>
    </tr>

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

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

<pre>
    **This testcase is generated by a fuzzer.**

Compiler Explorer: [https://godbolt.org/z/eTEfa1j95](https://godbolt.org/z/eTEfa1j95)

This invalid code will crash on clang trunk and clang assertion trunk with `-std=c++20`:
```cpp
template<typename T>
concept _Alignas(8) UnaryC = true;
template<typename T, typename U>
concept BinaryC = true;

void use() {
  UnaryC auto [a, b] = 0;
}
```

This goes back to clang-17.

Stack dump:
```
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-trunk/bin/clang++ -gdwarf-4 -g -o /app/output.s -mllvm --x86-asm-syntax=intel -fno-verbose-asm -S --gcc-toolchain=/opt/compiler-explorer/gcc-snapshot -fcolor-diagnostics -fno-crash-diagnostics -std=c++20 <source>
1.      <source>:7:22: current parser token '='
2.      <source>:6:12: parsing function body 'use'
3.      <source>:6:12: in compound statement ('{}')
 #0 0x00000000039a0ae8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x39a0ae8)
 #1 0x000000000399ec34 llvm::sys::CleanupOnSignal(unsigned long) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x399ec34)
 #2 0x00000000038ef568 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
 #3 0x00007f37e0a42520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #4 0x00000000067bc1a4 clang::Sema::ActOnDecompositionDeclarator(clang::Scope*, clang::Declarator&, llvm::MutableArrayRef<clang::TemplateParameterList*>) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x67bc1a4)
 #5 0x000000000671a3f5 clang::Sema::HandleDeclarator(clang::Scope*, clang::Declarator&, llvm::MutableArrayRef<clang::TemplateParameterList*>) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x671a3f5)
 #6 0x000000000671aecc clang::Sema::ActOnDeclarator(clang::Scope*, clang::Declarator&) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x671aecc)
 #7 0x000000000637480c clang::Parser::ParseDeclarationAfterDeclaratorAndAttributes(clang::Declarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::ForRangeInit*) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x637480c)
 #8 0x000000000638a63c clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, clang::DeclaratorContext, clang::ParsedAttributes&, clang::Parser::ParsedTemplateInfo&, clang::SourceLocation*, clang::Parser::ForRangeInit*) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x638a63c)
 #9 0x000000000638d16a clang::Parser::ParseSimpleDeclaration(clang::DeclaratorContext, clang::SourceLocation&, clang::ParsedAttributes&, clang::ParsedAttributes&, bool, clang::Parser::ForRangeInit*, clang::SourceLocation*) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x638d16a)
#10 0x000000000638d66f clang::Parser::ParseDeclaration(clang::DeclaratorContext, clang::SourceLocation&, clang::ParsedAttributes&, clang::ParsedAttributes&, clang::SourceLocation*) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x638d66f)
#11 0x0000000006440ff4 clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*, clang::ParsedAttributes&, clang::ParsedAttributes&) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x6440ff4)
#12 0x000000000644194d clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x644194d)
#13 0x0000000006442c64 clang::Parser::ParseCompoundStatementBody(bool) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x6442c64)
#14 0x0000000006444eda clang::Parser::ParseFunctionStatementBody(clang::Decl*, clang::Parser::ParseScope&) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x6444eda)
#15 0x0000000006340f16 clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x6340f16)
#16 0x000000000638aa9f clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, clang::DeclaratorContext, clang::ParsedAttributes&, clang::Parser::ParsedTemplateInfo&, clang::SourceLocation*, clang::Parser::ForRangeInit*) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x638aa9f)
#17 0x00000000063394c7 clang::Parser::ParseDeclOrFunctionDefInternal(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec&, clang::AccessSpecifier) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x63394c7)
#18 0x000000000633a2e3 clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*, clang::AccessSpecifier) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x633a2e3)
#19 0x0000000006343bd2 clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x6343bd2)
#20 0x0000000006345468 clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x6345468)
#21 0x0000000006333b3a clang::ParseAST(clang::Sema&, bool, bool) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x6333b3a)
#22 0x00000000042e99e5 clang::CodeGenAction::ExecuteAction() (/opt/compiler-explorer/clang-trunk/bin/clang+++0x42e99e5)
#23 0x00000000045b3021 clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-trunk/bin/clang+++0x45b3021)
#24 0x0000000004532fcb clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x4532fcb)
#25 0x0000000004697543 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x4697543)
#26 0x0000000000cf29cc cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/compiler-explorer/clang-trunk/bin/clang+++0xcf29cc)
#27 0x0000000000ceb42d ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) driver.cpp:0:0
#28 0x00000000043318f9 void llvm::function_ref<void ()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const::'lambda'()>(long) Job.cpp:0:0
#29 0x00000000038ef993 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x38ef993)
#30 0x0000000004331b19 clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const (.part.0) Job.cpp:0:0
#31 0x00000000042f93cd clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/opt/compiler-explorer/clang-trunk/bin/clang+++0x42f93cd)
#32 0x00000000042fa3cd clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&, bool) const (/opt/compiler-explorer/clang-trunk/bin/clang+++0x42fa3cd)
#33 0x000000000430397c clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x430397c)
#34 0x0000000000cef721 clang_main(int, char**, llvm::ToolContext const&) (/opt/compiler-explorer/clang-trunk/bin/clang+++0xcef721)
#35 0x0000000000bbffe4 main (/opt/compiler-explorer/clang-trunk/bin/clang+++0xbbffe4)
#36 0x00007f37e0a29d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#37 0x00007f37e0a29e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#38 0x0000000000ceaece _start (/opt/compiler-explorer/clang-trunk/bin/clang+++0xceaece)
clang++: error: clang frontend command failed with exit code 139 (use -v to see invocation)
Compiler returned: 139
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsWt9z26ry_2vIC2OPBJIsPeTBsePz7ZmeaabJ-b56EEIOpzLoAkqT_vV3ADkWiuOkvWrn3B-d1rUFLJ_97LK7CIjWfCcYuwTpFUjXF6Qz91JdPvG_iEjyJL0oZfV0CdASoOXdPdfQMG0o0QxyDXdMMEUMq2D5BAmsu2_fmJr7ziBag6j_XMl9yxum4PVj20jFFMBLCNKre2NaDfASoA1Am52sStmYuVQ7gDbfANqwu-uaxH8VKUjXAOXv746K4fQONxcPpOEVpLJi8CtvGkgV0fdQCkgbInbQqE58gURU_W-iNVOGS9G3fOXmHoIsmmlTAbymAF0BdIUikEUWk58vi_xf2rb-iWH7tiGGAbwyTy0TZM_gHcDXvpVKQVlr4HbZ8J0gGqA8B6iAfwqinlYQ4LWdnAF8dU4aWsHnX3--kH3FXxHmPx8kr2CnGUBuZrDoW-EBBOmMtMYidp4SpGsnKTqKWaxHyr_gfieZhiWhX6CRnt1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