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

    <tr>
        <th>Summary</th>
        <td>
            [clang] crash on function parameter with VLAs and _Countof
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang:frontend,
            crash
      </td>
    </tr>

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

    <tr>
      <th>Reporter</th>
      <td>
          k-arrows
      </td>
    </tr>
</table>

<pre>
    Reproducer:
https://godbolt.org/z/cqxn3aP6W
```c
void foo (char (*a)[*][2], int (*x)[_Countof (*a)]);
```

Backtrace:
```console
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 <source>
1.      <source>:1:51: current parser token ')'
 #0 0x0000000003cf8cd8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-trunk/bin/clang+0x3cf8cd8)
 #1 0x0000000003cf66ac llvm::sys::CleanupOnSignal(unsigned long) (/opt/compiler-explorer/clang-trunk/bin/clang+0x3cf66ac)
 #2 0x0000000003c46938 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
 #3 0x00007c38aee42520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #4 0x00000000074f1074 CheckICE(clang::Expr const*, clang::ASTContext const&) ExprConstant.cpp:0:0
 #5 0x00000000074f11e7 CheckICE(clang::Expr const*, clang::ASTContext const&) ExprConstant.cpp:0:0
 #6 0x00000000074f1b2b clang::Expr::isIntegerConstantExpr(clang::ASTContext const&) const (/opt/compiler-explorer/clang-trunk/bin/clang+0x74f1b2b)
 #7 0x000000000683b9cb clang::Sema::VerifyIntegerConstantExpression(clang::Expr*, llvm::APSInt*, clang::Sema::VerifyICEDiagnoser&, clang::AllowFoldKind) (/opt/compiler-explorer/clang-trunk/bin/clang+0x683b9cb)
 #8 0x0000000006f0532a clang::Sema::BuildArrayType(clang::QualType, clang::ArraySizeModifier, clang::Expr*, unsigned int, clang::SourceRange, clang::DeclarationName) (/opt/compiler-explorer/clang-trunk/bin/clang+0x6f0532a)
 #9 0x0000000006f1ba8d GetFullTypeForDeclarator((anonymous namespace)::TypeProcessingState&, clang::QualType, clang::TypeSourceInfo*) SemaType.cpp:0:0
#10 0x0000000006f22694 clang::Sema::GetTypeForDeclarator(clang::Declarator&) (/opt/compiler-explorer/clang-trunk/bin/clang+0x6f22694)
#11 0x0000000006687907 clang::Sema::ActOnParamDeclarator(clang::Scope*, clang::Declarator&, clang::SourceLocation) (/opt/compiler-explorer/clang-trunk/bin/clang+0x6687907)
#12 0x00000000063248ee clang::Parser::ParseParameterDeclarationClause(clang::DeclaratorContext, clang::ParsedAttributes&, llvm::SmallVectorImpl<clang::DeclaratorChunk::ParamInfo>&, clang::SourceLocation&, bool) (/opt/compiler-explorer/clang-trunk/bin/clang+0x63248ee)
#13 0x00000000063267a3 clang::Parser::ParseFunctionDeclarator(clang::Declarator&, clang::ParsedAttributes&, clang::BalancedDelimiterTracker&, bool, bool) (/opt/compiler-explorer/clang-trunk/bin/clang+0x63267a3)
#14 0x000000000632803f clang::Parser::ParseDirectDeclarator(clang::Declarator&) (/opt/compiler-explorer/clang-trunk/bin/clang+0x632803f)
#15 0x0000000006320cfe clang::Parser::ParseDeclaratorInternal(clang::Declarator&, void (clang::Parser::*)(clang::Declarator&)) (/opt/compiler-explorer/clang-trunk/bin/clang+0x6320cfe)
#16 0x0000000007ae1d31 clang::StackExhaustionHandler::runWithSufficientStackSpace(clang::SourceLocation, llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-trunk/bin/clang+0x7ae1d31)
#17 0x000000000631ca94 clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, clang::DeclaratorContext, clang::ParsedAttributes&, clang::Parser::ParsedTemplateInfo&, clang::SourceLocation*, clang::Parser::ForRangeInit*) (/opt/compiler-explorer/clang-trunk/bin/clang+0x631ca94)
#18 0x00000000062c90df clang::Parser::ParseDeclOrFunctionDefInternal(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec&, clang::AccessSpecifier) (/opt/compiler-explorer/clang-trunk/bin/clang+0x62c90df)
#19 0x00000000062c9ed7 clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*, clang::AccessSpecifier) (/opt/compiler-explorer/clang-trunk/bin/clang+0x62c9ed7)
#20 0x00000000062d2b1f clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*) (/opt/compiler-explorer/clang-trunk/bin/clang+0x62d2b1f)
#21 0x00000000062d4317 clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) (/opt/compiler-explorer/clang-trunk/bin/clang+0x62d4317)
#22 0x00000000062d4860 clang::Parser::ParseFirstTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) (/opt/compiler-explorer/clang-trunk/bin/clang+0x62d4860)
#23 0x00000000062c2933 clang::ParseAST(clang::Sema&, bool, bool) (/opt/compiler-explorer/clang-trunk/bin/clang+0x62c2933)
#24 0x00000000046405a5 clang::CodeGenAction::ExecuteAction() (/opt/compiler-explorer/clang-trunk/bin/clang+0x46405a5)
#25 0x000000000494c26a clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-trunk/bin/clang+0x494c26a)
#26 0x00000000048c57cb clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/compiler-explorer/clang-trunk/bin/clang+0x48c57cb)
#27 0x0000000004a3cff3 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-trunk/bin/clang+0x4a3cff3)
#28 0x0000000000dc0df5 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/compiler-explorer/clang-trunk/bin/clang+0xdc0df5)
#29 0x0000000000db8d9d ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) driver.cpp:0:0
#30 0x00000000046b2839 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
#31 0x0000000003c46d53 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-trunk/bin/clang+0x3c46d53)
#32 0x00000000046b2a59 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
#33 0x0000000004675ded clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/opt/compiler-explorer/clang-trunk/bin/clang+0x4675ded)
#34 0x0000000004676da1 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+0x4676da1)
#35 0x0000000004680bec clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/opt/compiler-explorer/clang-trunk/bin/clang+0x4680bec)
#36 0x0000000000dbd601 clang_main(int, char**, llvm::ToolContext const&) (/opt/compiler-explorer/clang-trunk/bin/clang+0xdbd601)
#37 0x0000000000c6c3f4 main (/opt/compiler-explorer/clang-trunk/bin/clang+0xc6c3f4)
#38 0x00007c38aee29d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#39 0x00007c38aee29e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#40 0x0000000000db8835 _start (/opt/compiler-explorer/clang-trunk/bin/clang+0xdb8835)
clang: error: clang frontend command failed with exit code 139 (use -v to see invocation)
Compiler returned: 139
```
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJzkWl1zozgW_TXkRYULxIfhIQ-ExL2Z7dnOtlMzjy4hhK0NSIwk0s78-i1J2BjsuDNjd1dt7dR0QkDonnPu1dWVBJKSrhkht05050T3N6hTGy5uX1wkBP8mbwpevt1-Ja3gZYeJcILM8bKNUq3Ul3DhwMWalwWv1YyLtQMXfzpwgf_YsgA9xb87XubEnv0fO172ymkJKs6BAxO8QUL_dmCGHJhq-zBzonsnuoP6F8wBZapvsbUtVjnvmOLV6L17_TO4O7Slr73sDuEXJRAmFvWAhDPJa-J42dPnh2z5AGRXNFQBBIpuDQRpuVBAcTChSdWmK2aYNw5c1PXr7pfbCv4fgpUDF1TKjkgHLgBiJaAM111JgNoQgAWSG1DsAcEctEKriomUpASSd8Le1m8iKTmmSJESiI4BiQVt1czxsqVC-AWUXdNaSt7M8dInwdcCNQCJddcQpjRk4MAFbzUmzJuW1kS4ZNvWXBCh79WIrV0lOvbiwEVB2e4ecNflNyQqNwTuGrjaTwvUtrqzTrWdmkngNpo0cN1tErtINq58YwptneCeMkVq4FaMu69EFFwS_Ry4S-C6a4xdxXmNN4gyJ7g_C083lgy1csMVcCvMay7ckqI141JRLK0NI-nothPkvY7Bg-NlvhZndC_IfCfIIv0D4E4IwhRokZBEAMVfCAMOnOtggnPH0xIGHvC23u6_AFcJLhNgfB9kTpDJN2kvngRlyjjn2bo3GRoJ9G3FpRIENQ6M-7B2YGpj-O94yYF33rZHo-FarP4EaxwjfAprXhPEuvYLW9I1Q7UDk46ZHFCCmuvOr4BM2x6QwTGyME6DBOTafV8J5q9EvFko_0CsrLWBpFdo1CbnTJGtmuFWB79n_tn-g77_OQ4SREgII-j1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