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

    <tr>
        <th>Summary</th>
        <td>
            [clang] Crash with official test `SemaTemplate/instantiate-template-template-parm.cpp` and template alias
        </td>
    </tr>

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

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

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

<pre>
    Goes back to clang-16: https://godbolt.org/z/eY5TK6M4a.

Generated by fuzzer that involves template alias.

Seed program: https://github.com/llvm/llvm-project/blob/main/clang/test/SemaTemplate/instantiate-template-template-parm.cpp

Stack Dump:

```c++

Unknown builtin type!
UNREACHABLE executed at /root/llvm-project/clang/lib/AST/ASTContext.cpp:2055!
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/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>:43:5: current parser token '{'
2.      <source>:4:1: parsing namespace 'PR8629'
3.      <source>:40:3: parsing struct/union/class body 'PR8629::X1Container'
 #0 0x0000000003e9fee8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3e9fee8)
 #1 0x0000000003e9db74 llvm::sys::CleanupOnSignal(unsigned long) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3e9db74)
 #2 0x0000000003de2f18 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
 #3 0x0000798c5c242520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #4 0x0000798c5c2969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
 #5 0x0000798c5c242476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
 #6 0x0000798c5c2287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
 #7 0x0000000003dedf4a (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3dedf4a)
 #8 0x00000000073f1a0c clang::ASTContext::getTypeInfoImpl(clang::Type const*) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x73f1a0c)
 #9 0x00000000073d9d47 clang::ASTContext::getTypeInfo(clang::Type const*) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x73d9d47)
#10 0x00000000073f1cbb clang::ASTContext::getTypeInfoInChars(clang::Type const*) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x73f1cbb)
#11 0x00000000073f2473 clang::ASTContext::getTypeInfoInChars(clang::QualType) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x73f2473)
#12 0x0000000007aa9815 (anonymous namespace)::ItaniumRecordLayoutBuilder::LayoutField(clang::FieldDecl const*, bool) RecordLayoutBuilder.cpp:0:0
#13 0x0000000007aab302 (anonymous namespace)::ItaniumRecordLayoutBuilder::LayoutFields(clang::RecordDecl const*) RecordLayoutBuilder.cpp:0:0
#14 0x0000000007aa5704 clang::ASTContext::getASTRecordLayout(clang::RecordDecl const*) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x7aa5704)
#15 0x00000000073f17ca clang::ASTContext::getTypeInfoImpl(clang::Type const*) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x73f17ca)
#16 0x00000000073d9d47 clang::ASTContext::getTypeInfo(clang::Type const*) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x73d9d47)
#17 0x00000000073f08a7 clang::ASTContext::getTypeAlignInChars(clang::QualType) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x73f08a7)
#18 0x00000000067170a3 clang::Sema::CheckArgAlignment(clang::SourceLocation, clang::NamedDecl*, llvm::StringRef, clang::QualType, clang::QualType) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x67170a3)
#19 0x00000000067423ba clang::Sema::CheckConstructorCall(clang::FunctionDecl*, clang::QualType, llvm::ArrayRef<clang::Expr const*>, clang::FunctionProtoType const*, clang::SourceLocation) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x67423ba)
#20 0x00000000068e479c clang::Sema::CompleteConstructorCall(clang::CXXConstructorDecl*, clang::QualType, llvm::MutableArrayRef<clang::Expr*>, clang::SourceLocation, llvm::SmallVectorImpl<clang::Expr*>&, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x68e479c)
#21 0x0000000006bafd4d PerformConstructorInitialization(clang::Sema&, clang::InitializedEntity const&, clang::InitializationKind const&, llvm::MutableArrayRef<clang::Expr*>, clang::InitializationSequence::Step const&, bool&, bool, bool, clang::SourceLocation, clang::SourceLocation) SemaInit.cpp:0:0
#22 0x0000000006bb6dba clang::InitializationSequence::Perform(clang::Sema&, clang::InitializedEntity const&, clang::InitializationKind const&, llvm::MutableArrayRef<clang::Expr*>, clang::QualType*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6bb6dba)
#23 0x00000000068fb3ca BuildImplicitMemberInitializer(clang::Sema&, clang::CXXConstructorDecl*, ImplicitInitializerKind, clang::FieldDecl*, clang::IndirectFieldDecl*, clang::CXXCtorInitializer*&) (.constprop.0) SemaDeclCXX.cpp:0:0
#24 0x00000000068fbffc CollectFieldInitializer(clang::Sema&, (anonymous namespace)::BaseAndFieldInfo&, clang::FieldDecl*, clang::IndirectFieldDecl*) SemaDeclCXX.cpp:0:0
#25 0x000000000692f1dd clang::Sema::SetCtorInitializers(clang::CXXConstructorDecl*, bool, llvm::ArrayRef<clang::CXXCtorInitializer*>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x692f1dd)
#26 0x000000000692fcf2 clang::Sema::ActOnDefaultCtorInitializers(clang::Decl*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x692fcf2)
#27 0x00000000064e2fb5 clang::Parser::ParseLexedMethodDef(clang::Parser::LexedMethod&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x64e2fb5)
#28 0x00000000064e2cdd clang::Parser::ParseLexedMethodDefs(clang::Parser::ParsingClass&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x64e2cdd)
#29 0x000000000653534e clang::Parser::ParseCXXMemberSpecification(clang::SourceLocation, clang::SourceLocation, clang::ParsedAttributes&, unsigned int, clang::Decl*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x653534e)
#30 0x0000000006537953 clang::Parser::ParseClassSpecifier(clang::tok::TokenKind, clang::SourceLocation, clang::DeclSpec&, clang::Parser::ParsedTemplateInfo&, clang::AccessSpecifier, bool, clang::Parser::DeclSpecContext, clang::ParsedAttributes&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6537953)
#31 0x000000000650b958 clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&, clang::Parser::ParsedTemplateInfo&, clang::AccessSpecifier, clang::Parser::DeclSpecContext, clang::Parser::LateParsedAttrList*, clang::ImplicitTypenameContext) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x650b958)
#32 0x00000000064c8324 clang::Parser::ParseDeclOrFunctionDefInternal(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec&, clang::AccessSpecifier) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x64c8324)
#33 0x00000000064c8d89 clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*, clang::AccessSpecifier) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x64c8d89)
#34 0x00000000064d0653 clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x64d0653)
#35 0x000000000652cf54 clang::Parser::ParseInnerNamespace(llvm::SmallVector<clang::Parser::InnerNamespaceInfo, 4u> const&, unsigned int, clang::SourceLocation&, clang::ParsedAttributes&, clang::BalancedDelimiterTracker&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x652cf54)
#36 0x000000000652db83 clang::Parser::ParseNamespace(clang::DeclaratorContext, clang::SourceLocation&, clang::SourceLocation) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x652db83)
#37 0x0000000006512650 clang::Parser::ParseDeclaration(clang::DeclaratorContext, clang::SourceLocation&, clang::ParsedAttributes&, clang::ParsedAttributes&, clang::SourceLocation*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6512650)
#38 0x00000000064d0697 clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x64d0697)
#39 0x00000000064d156d clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x64d156d)
#40 0x00000000064c3aba clang::ParseAST(clang::Sema&, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x64c3aba)
#41 0x00000000048325b8 clang::CodeGenAction::ExecuteAction() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x48325b8)
#42 0x0000000004b1ff05 clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4b1ff05)
#43 0x0000000004aa1bbe clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4aa1bbe)
#44 0x0000000004c1027e clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4c1027e)
#45 0x0000000000d5a10f cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xd5a10f)
#46 0x0000000000d518ca ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) driver.cpp:0:0
#47 0x0000000004897c99 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
#48 0x0000000003de33b4 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3de33b4)
#49 0x00000000048982af 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
#50 0x000000000485ad1d clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x485ad1d)
#51 0x000000000485bdae clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&, bool) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x485bdae)
#52 0x0000000004863485 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4863485)
#53 0x0000000000d56f08 clang_main(int, char**, llvm::ToolContext const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xd56f08)
#54 0x0000000000c1dcc4 main (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xc1dcc4)
#55 0x0000798c5c229d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#56 0x0000798c5c229e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#57 0x0000000000d51375 _start (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xd51375)
clang++: error: clang frontend command failed with exit code 134 (use -v to see invocation)

```
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJzkW91S5LiSfhpzoyjClv8vuDAFzGEOPc027EbvFSFLcpUWl-QjyTT0029IdmHL5SpgDtUTE2eCoY0tpb78MpVK_SGl2IpTeubF5158cYJavRby7Fur1oEPw_CkFOTl7DdBFSgRfgRaAFwjvloEiRcWYK11o7yw8OCVB69WgpSi1qdCrjx49dODV_R_4_t_Jl8idOr5hecXv1FOJdKUgPIFVO3Pn1QCvUYaMP4k6ieqgKabpkaaAlQzpPpqd5QS0Eixkmgz0yzT67Y8xWLjwau6ftr-s2ik-D-KtQevylqUHrzaIMY9eGU18OCVpsp8vKMbdN8368ErxpVGXDOk6WKLZnhokNyc4qbpgWlDykW7aQwa-8pL_O4He_Dc_Ni3_80fufjBQdmyWjMO9EtDPRiYL398uyyW_yjOby4Bfaa4NewgDTx4JYXQu7ps0dfMqFTc3Xe_l4Jr-qwttrCAfhx38m9vLou7S6DacsM0QKBsV0DSRkhtjPlhJplSLVUevAKIE8A4rltCgV5TgCVSa-slWiJMPbgEjaSNFJgqRQlQopXda1MTKSUws64gWw4UlqzRp6-UkldK_VPPz2872wMkV-2Gcm0gG4ZEYxkRm4bVVC7oc1MLSeWWpQVSikrNBFcLLVv-aFxh7ALGQGCxIj-QrBYRWKzAQhi5qGmM9FY3rT5VYLExLIDF4jlLFkhtFuqFa_TshReMa1qDRcXF4onKUihqvoPFHVgsVhgvtBA1Xhu3Cy8O4jWFFUeNWgsNFhUWtZALwtCKC6UZVl0blmPntRcue2LDS88vAsOW8y4sotALi9gwhlspKdegQVKZniceKQceTL303Pz2CzhX3QuLwNQ2tRhfAY42VDUIU1P19luWwLyrHc7V9r2wCMfVlZatdaWWM9HbQilgAs1IYFh4YfE9MF6NGD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