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

    <tr>
        <th>Summary</th>
        <td>
            clang 18.1.0 crashes in `clang::ASTContext::getTypeInfoImpl`
        </td>
    </tr>

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

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

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

<pre>
    ```
<source>:3:3: error: no template named '__impl_'; did you mean '__impl_of'?
    3 | __impl_;
      |   ^~~~~~~
      |   __impl_of
<source>:1:20: note: '__impl_of' declared here
    1 | template <class a> using __impl_of = a;
      |                    ^
<source>:3:3: error: cannot specify deduction guide for alias template '__impl_of'
    3 |   __impl_;
 |   ^
<source>:1:20: note: template is declared here
    1 | template <class a> using __impl_of = a;
      | ^
<source>:3:11: error: expected '}'
    3 |   __impl_;
      | ^
<source>:2:8: note: to match this '{'
    2 | struct {
 |        ^
<source>:3:11: error: expected ';' after struct
    3 | __impl_;
      |           ^
      |           ;
<source>:2:1: error: anonymous structs and classes must be class members
    2 | struct {
      | ^
Unknown builtin type!
UNREACHABLE executed at /root/llvm-project/clang/lib/AST/ASTContext.cpp:1972!
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-18.1.0/bin/clang++ -gdwarf-4 -g -o /app/output.s -mllvm --x86-asm-syntax=intel -S --gcc-toolchain=/opt/compiler-explorer/gcc-13.2.0 -fcolor-diagnostics -fno-crash-diagnostics <source>
1.      <eof> parser at end of file
 #0 0x00000000038d53d8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+++0x38d53d8)
 #1 0x00000000038d30bc llvm::sys::CleanupOnSignal(unsigned long) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+++0x38d30bc)
 #2 0x000000000381baa8 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
 #3 0x00007f1655c42520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #4 0x00007f1655c969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
 #5 0x00007f1655c42476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
 #6 0x00007f1655c287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
 #7 0x0000000003826d3a (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+++0x3826d3a)
 #8 0x000000000704cfed clang::ASTContext::getTypeInfoImpl(clang::Type const*) const (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+++0x704cfed)
 #9 0x0000000007035007 clang::ASTContext::getTypeInfo(clang::Type const*) const (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+++0x7035007)
#10 0x000000000704d2db clang::ASTContext::getTypeInfoInChars(clang::Type const*) const (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+++0x704d2db)
#11 0x000000000704d3f3 clang::ASTContext::getTypeInfoInChars(clang::QualType) const (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+++0x704d3f3)
#12 0x0000000007500595 (anonymous namespace)::ItaniumRecordLayoutBuilder::LayoutField(clang::FieldDecl const*, bool) RecordLayoutBuilder.cpp:0:0
#13 0x0000000007501e1f (anonymous namespace)::ItaniumRecordLayoutBuilder::LayoutFields(clang::RecordDecl const*) RecordLayoutBuilder.cpp:0:0
#14 0x00000000074fd6e6 clang::ASTContext::getASTRecordLayout(clang::RecordDecl const*) const (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+++0x74fd6e6)
#15 0x000000000704ce7c clang::ASTContext::getTypeInfoImpl(clang::Type const*) const (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+++0x704ce7c)
#16 0x0000000007035007 clang::ASTContext::getTypeInfo(clang::Type const*) const (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+++0x7035007)
#17 0x000000000704bff7 clang::ASTContext::getTypeAlignInChars(clang::QualType) const (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+++0x704bff7)
#18 0x00000000062db540 clang::Sema::CheckArgAlignment(clang::SourceLocation, clang::NamedDecl*, llvm::StringRef, clang::QualType, clang::QualType) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+++0x62db540)
#19 0x000000000630f007 clang::Sema::CheckConstructorCall(clang::FunctionDecl*, clang::QualType, llvm::ArrayRef<clang::Expr const*>, clang::FunctionProtoType const*, clang::SourceLocation) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+++0x630f007)
#20 0x00000000064feb3c clang::Sema::CompleteConstructorCall(clang::CXXConstructorDecl*, clang::QualType, llvm::MutableArrayRef<clang::Expr*>, clang::SourceLocation, llvm::SmallVectorImpl<clang::Expr*>&, bool, bool) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+++0x64feb3c)
#21 0x000000000684d270 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 0x0000000006860fc5 clang::InitializationSequence::Perform(clang::Sema&, clang::InitializedEntity const&, clang::InitializationKind const&, llvm::MutableArrayRef<clang::Expr*>, clang::QualType*) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+++0x6860fc5)
#23 0x000000000645aa94 clang::Sema::ActOnUninitializedDecl(clang::Decl*) (.part.0) SemaDecl.cpp:0:0
#24 0x000000000645bc43 clang::Sema::BuildAnonymousStructOrUnion(clang::Scope*, clang::DeclSpec&, clang::AccessSpecifier, clang::RecordDecl*, clang::PrintingPolicy const&) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+++0x645bc43)
#25 0x000000000645d6f1 clang::Sema::ParsedFreeStandingDeclSpec(clang::Scope*, clang::AccessSpecifier, clang::DeclSpec&, clang::ParsedAttributesView const&, llvm::MutableArrayRef<clang::TemplateParameterList*>, bool, clang::RecordDecl*&) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+++0x645d6f1)
#26 0x000000000645fa12 clang::Sema::ParsedFreeStandingDeclSpec(clang::Scope*, clang::AccessSpecifier, clang::DeclSpec&, clang::ParsedAttributesView const&, clang::RecordDecl*&) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+++0x645fa12)
#27 0x00000000060f49d1 clang::Parser::ParseDeclOrFunctionDefInternal(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec&, clang::AccessSpecifier) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+++0x60f49d1)
#28 0x00000000060f5261 clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*, clang::AccessSpecifier) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+++0x60f5261)
#29 0x00000000060fc516 clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+++0x60fc516)
#30 0x00000000060fd3bd clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+++0x60fd3bd)
#31 0x00000000060f02ea clang::ParseAST(clang::Sema&, bool, bool) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+++0x60f02ea)
#32 0x000000000415d928 clang::CodeGenAction::ExecuteAction() (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+++0x415d928)
#33 0x00000000043cbfe9 clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+++0x43cbfe9)
#34 0x000000000434ba9e clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+++0x434ba9e)
#35 0x00000000044ab01e clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+++0x44ab01e)
#36 0x0000000000c10cd6 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+++0xc10cd6)
#37 0x0000000000c084fa ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) driver.cpp:0:0
#38 0x000000000419ee49 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
#39 0x000000000381bf54 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+++0x381bf54)
#40 0x000000000419f43f 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
#41 0x00000000041671c5 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+++0x41671c5)
#42 0x0000000004167c2d clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&, bool) const (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+++0x4167c2d)
#43 0x000000000416fb65 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+++0x416fb65)
#44 0x0000000000c0e06c clang_main(int, char**, llvm::ToolContext const&) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+++0xc0e06c)
#45 0x0000000000b05134 main (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+++0xb05134)
#46 0x00007f1655c29d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#47 0x00007f1655c29e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#48 0x0000000000c07fde _start (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+++0xc07fde)
clang++: error: clang frontend command failed with exit code 134 (use -v to see invocation)
Compiler returned: 134
```

```c++
template <class a> using __impl_of = a;
struct {
 __impl_;
```
https://godbolt.org/z/evb35d63s
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzkW1tz47aS_jX0C0ouEryIevCDLNvnTHaS8UZOKm8qEGhK2CEBBgA9ch72t28BpCyCknxJrElljyvOSLh0f_11o9EEYaI1XwuAqyC9DtKbC9KajVRXsjKyqi8KyZ6ugizs_wtvgnAexAstW0UhiG-DeB73vwiUksp-EBIZqJuKGECC1MBQgKerFa-bahXgaRBfI8YZepItqoGIQa8sXf9dpwghhGIUTBdoNzm-3vcg14NQkN7-r_s57NpLPQY8CuI5DjvABuy_IyCIAa2IAoY2oGAvPnLin00M4gWtiNaIBPEtajUX671mFMQ3tuMI8IOfIL19I8OUCCEN0g1QXj4hBqylhkuB1i1ngEqpEKk40QOQI45HBKNDip_ZfSN5z6q4PitxL7EURR5NsG2Ami7-gunN2-x-VREO4nnuWS5RTQzdILPhutN17enCTp42qqUG2c4hw6-6_iWjYqsIkdKA6uW_Z-kcaD_auZt5hAYfGRFSPNWy1T0UjYhgyLkYNKpbbVAB3XdUQ12A0q9ydOiNX8RXIb8JVLS8Mlwg89RAgKO-86efb-eLf8-vP98i2AJtLVHEoADfKSlNgO-q6rGeNEr-D1D7lVZErG0zLwJ8N18-dP9fSGFgay5p01gzZ1P8rOL-8-18eYt0W9TcIIKKdo0UNFIZGwgbYxodxPMA3wX4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