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

    <tr>
        <th>Summary</th>
        <td>
            [clang] Assertion `(T->hasIntegerRepresentation() || T->isEnumeralType() || T->isFixedPointType()) && "Unexpected type"' failed.
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            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/G7Ea4EGGE](https://godbolt.org/z/G7Ea4EGGE)

This invalid code will crash on Clang Assertion Trunk:
```cpp
void c2(int *a) {}
void t3() {
  _BitInt(A(32)) v2 __attribute__((cleanup(c2)));
}
```

It seems that this goes back to clang-14.

Stack dump:
```
clang++: /root/llvm-project/clang/lib/AST/ASTContext.cpp:11703: clang::QualType clang::ASTContext::getCorrespondingUnsignedType(clang::QualType) const: Assertion `(T->hasIntegerRepresentation() || T->isEnumeralType() || T->isFixedPointType()) && "Unexpected type"' 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/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>:3:49: current parser token ';'
2.      <source>:2:11: parsing function body 't3'
3.      <source>:2:11: in compound statement ('{}')
 #0 0x0000000003bb93f8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3bb93f8)
 #1 0x0000000003bb70bc llvm::sys::CleanupOnSignal(unsigned long) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3bb70bc)
 #2 0x0000000003b046a8 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
 #3 0x00007f9b1ec42520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #4 0x00007f9b1ec969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
 #5 0x00007f9b1ec42476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
 #6 0x00007f9b1ec287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
 #7 0x00007f9b1ec2871b (/lib/x86_64-linux-gnu/libc.so.6+0x2871b)
 #8 0x00007f9b1ec39e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
 #9 0x00000000078719fe clang::ASTContext::getCorrespondingUnsignedType(clang::QualType) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x78719fe)
#10 0x0000000006bd8348 checkPointerTypesForAssignment(clang::Sema&, clang::QualType, clang::QualType, clang::SourceLocation) SemaExpr.cpp:0:0
#11 0x0000000006be9ddc clang::Sema::CheckAssignmentConstraints(clang::QualType, clang::ActionResult<clang::Expr*, true>&, clang::CastKind&, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6be9ddc)
#12 0x0000000006beaaf1 clang::Sema::CheckAssignmentConstraints(clang::SourceLocation, clang::QualType, clang::QualType) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6beaaf1)
#13 0x0000000006a71047 handleCleanupAttr(clang::Sema&, clang::Decl*, clang::ParsedAttr const&) SemaDeclAttr.cpp:0:0
#14 0x0000000006aae951 ProcessDeclAttribute(clang::Sema&, clang::Scope*, clang::Decl*, clang::ParsedAttr const&, clang::Sema::ProcessDeclAttributeOptions const&) (.isra.0) SemaDeclAttr.cpp:0:0
#15 0x0000000006aaff33 clang::Sema::ProcessDeclAttributes(clang::Scope*, clang::Decl*, clang::Declarator const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6aaff33)
#16 0x0000000006a3566c clang::Sema::ActOnVariableDeclarator(clang::Scope*, clang::Declarator&, clang::DeclContext*, clang::TypeSourceInfo*, clang::LookupResult&, llvm::MutableArrayRef<clang::TemplateParameterList*>, bool&, llvm::ArrayRef<clang::BindingDecl*>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6a3566c)
#17 0x0000000006a4bfd4 clang::Sema::HandleDeclarator(clang::Scope*, clang::Declarator&, llvm::MutableArrayRef<clang::TemplateParameterList*>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6a4bfd4)
#18 0x0000000006a4ca40 clang::Sema::ActOnDeclarator(clang::Scope*, clang::Declarator&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6a4ca40)
#19 0x00000000066acfde clang::Parser::ParseDeclarationAfterDeclaratorAndAttributes(clang::Declarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::ForRangeInit*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x66acfde)
#20 0x00000000066bca59 clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, clang::DeclaratorContext, clang::ParsedAttributes&, clang::Parser::ParsedTemplateInfo&, clang::SourceLocation*, clang::Parser::ForRangeInit*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x66bca59)
#21 0x00000000066c5377 clang::Parser::ParseSimpleDeclaration(clang::DeclaratorContext, clang::SourceLocation&, clang::ParsedAttributes&, clang::ParsedAttributes&, bool, clang::Parser::ForRangeInit*, clang::SourceLocation*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x66c5377)
#22 0x00000000066c5839 clang::Parser::ParseDeclaration(clang::DeclaratorContext, clang::SourceLocation&, clang::ParsedAttributes&, clang::ParsedAttributes&, clang::SourceLocation*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x66c5839)
#23 0x0000000006771ea2 clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*, clang::ParsedAttributes&, clang::ParsedAttributes&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6771ea2)
#24 0x0000000006772bd0 clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6772bd0)
#25 0x0000000006773aa5 clang::Parser::ParseCompoundStatementBody(bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6773aa5)
#26 0x00000000067751fa clang::Parser::ParseFunctionStatementBody(clang::Decl*, clang::Parser::ParseScope&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x67751fa)
#27 0x0000000006688d83 clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6688d83)
#28 0x00000000066bd43d clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, clang::DeclaratorContext, clang::ParsedAttributes&, clang::Parser::ParsedTemplateInfo&, clang::SourceLocation*, clang::Parser::ForRangeInit*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x66bd43d)
#29 0x000000000667cace clang::Parser::ParseDeclOrFunctionDefInternal(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec&, clang::AccessSpecifier) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x667cace)
#30 0x000000000667d28e clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*, clang::AccessSpecifier) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x667d28e)
#31 0x0000000006684a23 clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6684a23)
#32 0x000000000668590d clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x668590d)
#33 0x0000000006677e2a clang::ParseAST(clang::Sema&, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6677e2a)
#34 0x000000000452f368 clang::CodeGenAction::ExecuteAction() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x452f368)
#35 0x00000000047ea629 clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x47ea629)
#36 0x000000000476911e clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x476911e)
#37 0x00000000048cfcfe clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x48cfcfe)
#38 0x0000000000cde1ef cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xcde1ef)
#39 0x0000000000cd5efa ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) driver.cpp:0:0
#40 0x0000000004573089 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
#41 0x0000000003b04b54 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3b04b54)
#42 0x000000000457367f 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
#43 0x0000000004538f7d clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4538f7d)
#44 0x000000000453a06d 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+++0x453a06d)
#45 0x0000000004541995 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4541995)
#46 0x0000000000cdb0bf clang_main(int, char**, llvm::ToolContext const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xcdb0bf)
#47 0x0000000000baa1b4 main (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xbaa1b4)
#48 0x00007f9b1ec29d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#49 0x00007f9b1ec29e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#50 0x0000000000cd59ae _start (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xcd59ae)
clang++: error: clang frontend command failed with exit code 134 (use -v to see invocation)
Compiler returned: 134
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsW11z4yjW_jXKDWWXBPq8yIXixP1m3p7qbCczty6EkM20DFpAaad__RZIio38EWcm7p2t3S53yhZweM5zPjhICCvFlpzSay-68aLbK9zqlZDXL-wPzMM0jK4KUb5cezD3YP60YgpoqjTBigKmwJJyKrGmJSheAAZV--MHldOus-ffen7_dybWDaupBHebphaSSg_lwItuVlo3ykO5B-cenC9FWYhaT4VcenD-w4PzT8kdDu8-fbrzolsPpud3h9nu9BY348-4ZiUgoqTgO6trQCRWKyA4mNWYL0GuFJWaCQ6eZMu_mXk6GbHffUjTdFeehZEDPZgyroEHc-zBDHjJjZfc7vT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