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

    <tr>
        <th>Summary</th>
        <td>
            Clang12 ICE
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

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

    <tr>
      <th>Reporter</th>
      <td>
          PeterBindels-TomTom
      </td>
    </tr>
</table>

<pre>
    Trying to compile a relatively small TU resulted in this ICE. Have not tried Clang 13/14.

[crash.zip](https://github.com/llvm/llvm-project/files/8774438/crash.zip) - contains script and preprocessed source as requested below.

PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0.      Program arguments: clang++-12 -fdiagnostics-color=always -O3 -st

d=c++20 -Wall -Wextra -Wpedantic -Werror -pthread -stdlib=libc++ -c -o build/linux/obj/src/uimain.cpp.o src/uimain.cpp -I./include
1.      src/ui.h:177:47: current parser token ')'
2.      src/ui.h:5:1: parsing namespace 'UI'
3.      src/ui.h:173:1: parsing struct/union/class body 'UI::TextBox'
 #0 0x00007fae66810ae3 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/lib/x86_64-linux-gnu/libLLVM-12.so.1+0xbd9ae3)
 #1 0x00007fae6680edf0 llvm::sys::RunSignalHandlers() (/lib/x86_64-linux-gnu/libLLVM-12.so.1+0xbd7df0)
 #2 0x00007fae6675fe76 (/lib/x86_64-linux-gnu/libLLVM-12.so.1+0xb28e76)
 #3 0x00007fae6e0821f0 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x141f0)
 #4 0x00007fae6c95ed46 (/lib/x86_64-linux-gnu/libclang-cpp.so.12+0x1538d46)
 #5 0x00007fae6c94f5cb (/lib/x86_64-linux-gnu/libclang-cpp.so.12+0x15295cb)
 #6 0x00007fae6c94f098 clang::Sema::GetTypeForDeclarator(clang::Declarator&, clang::Scope*) (/lib/x86_64-linux-gnu/libclang-cpp.so.12+0x1529098)
 #7 0x00007fae6c4c979d clang::Sema::ActOnParamDeclarator(clang::Scope*, clang::Declarator&) (/lib/x86_64-linux-gnu/libclang-cpp.so.12+0x10a379d)
 #8 0x00007fae6bd83588 clang::Parser::ParseParameterDeclarationClause(clang::DeclaratorContext, clang::ParsedAttributes&, llvm::SmallVectorImpl<clang::DeclaratorChunk::ParamInfo>&, clang::SourceLocation&) (/lib/x86_64-linux-gnu/libclang-cpp.so.12+0x95d588)
 #9 0x00007fae6bd80f45 clang::Parser::ParseFunctionDeclarator(clang::Declarator&, clang::ParsedAttributes&, clang::BalancedDelimiterTracker&, bool, bool) (/lib/x86_64-linux-gnu/libclang-cpp.so.12+0x95af45)
#10 0x00007fae6bd7f1a6 clang::Parser::ParseDirectDeclarator(clang::Declarator&) (/lib/x86_64-linux-gnu/libclang-cpp.so.12+0x9591a6)
#11 0x00007fae6bd7d0c3 clang::Parser::ParseDeclaratorInternal(clang::Declarator&, void (clang::Parser::*)(clang::Declarator&)) (/lib/x86_64-linux-gnu/libclang-cpp.so.12+0x9570c3)
#12 0x00007fae6bd91770 clang::Parser::ParseCXXMemberDeclaratorBeforeInitializer(clang::Declarator&, clang::VirtSpecifiers&, clang::ActionResult<clang::Expr*, true>&, clang::Parser::LateParsedAttrList&) (/lib/x86_64-linux-gnu/libclang-cpp.so.12+0x96b770)
#13 0x00007fae6bd930c3 clang::Parser::ParseCXXClassMemberDeclaration(clang::AccessSpecifier, clang::ParsedAttributes&, clang::Parser::ParsedTemplateInfo const&, clang::ParsingDeclRAIIObject*) (/lib/x86_64-linux-gnu/libclang-cpp.so.12+0x96d0c3)
#14 0x00007fae6be00d62 clang::Parser::ParseSingleDeclarationAfterTemplate(clang::DeclaratorContext, clang::Parser::ParsedTemplateInfo const&, clang::ParsingDeclRAIIObject&, clang::SourceLocation&, clang::ParsedAttributes&, clang::AccessSpecifier) (/lib/x86_64-linux-gnu/libclang-cpp.so.12+0x9dad62)
#15 0x00007fae6be0044e clang::Parser::ParseTemplateDeclarationOrSpecialization(clang::DeclaratorContext, clang::SourceLocation&, clang::ParsedAttributes&, clang::AccessSpecifier) (/lib/x86_64-linux-gnu/libclang-cpp.so.12+0x9da44e)
#16 0x00007fae6bd92646 clang::Parser::ParseCXXClassMemberDeclaration(clang::AccessSpecifier, clang::ParsedAttributes&, clang::Parser::ParsedTemplateInfo const&, clang::ParsingDeclRAIIObject*) (/lib/x86_64-linux-gnu/libclang-cpp.so.12+0x96c646)
#17 0x00007fae6bd95ac5 clang::Parser::ParseCXXClassMemberDeclarationWithPragmas(clang::AccessSpecifier&, clang::Parser::ParsedAttributesWithRange&, clang::TypeSpecifierType, clang::Decl*) (/lib/x86_64-linux-gnu/libclang-cpp.so.12+0x96fac5)
#18 0x00007fae6bd9001d clang::Parser::ParseCXXMemberSpecification(clang::SourceLocation, clang::SourceLocation, clang::Parser::ParsedAttributesWithRange&, unsigned int, clang::Decl*) (/lib/x86_64-linux-gnu/libclang-cpp.so.12+0x96a01d)
#19 0x00007fae6bd8d954 clang::Parser::ParseClassSpecifier(clang::tok::TokenKind, clang::SourceLocation, clang::DeclSpec&, clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier, bool, clang::Parser::DeclSpecContext, clang::Parser::ParsedAttributesWithRange&) (/lib/x86_64-linux-gnu/libclang-cpp.so.12+0x967954)
#20 0x00007fae6bd6ed9f clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&, clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier, clang::Parser::DeclSpecContext, clang::Parser::LateParsedAttrList*) (/lib/x86_64-linux-gnu/libclang-cpp.so.12+0x948d9f)
#21 0x00007fae6be104ba clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec&, clang::AccessSpecifier) (/lib/x86_64-linux-gnu/libclang-cpp.so.12+0x9ea4ba)
#22 0x00007fae6be1019c clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec*, clang::AccessSpecifier) (/lib/x86_64-linux-gnu/libclang-cpp.so.12+0x9ea19c)
#23 0x00007fae6be0f33f clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec*) (/lib/x86_64-linux-gnu/libclang-cpp.so.12+0x9e933f)
#24 0x00007fae6bd87a2a clang::Parser::ParseInnerNamespace(llvm::SmallVector<clang::Parser::InnerNamespaceInfo, 4u> const&, unsigned int, clang::SourceLocation&, clang::ParsedAttributes&, clang::BalancedDelimiterTracker&) (/lib/x86_64-linux-gnu/libclang-cpp.so.12+0x961a2a)
#25 0x00007fae6bd875df clang::Parser::ParseNamespace(clang::DeclaratorContext, clang::SourceLocation&, clang::SourceLocation) (/lib/x86_64-linux-gnu/libclang-cpp.so.12+0x9615df)
#26 0x00007fae6bd6e57c clang::Parser::ParseDeclaration(clang::DeclaratorContext, clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&, clang::SourceLocation*) (/lib/x86_64-linux-gnu/libclang-cpp.so.12+0x94857c)
#27 0x00007fae6be0eb0c clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec*) (/lib/x86_64-linux-gnu/libclang-cpp.so.12+0x9e8b0c)
#28 0x00007fae6be0db2f clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, bool) (/lib/x86_64-linux-gnu/libclang-cpp.so.12+0x9e7b2f)
#29 0x00007fae6bd5ec0d clang::ParseAST(clang::Sema&, bool, bool) (/lib/x86_64-linux-gnu/libclang-cpp.so.12+0x938c0d)
#30 0x00007fae6d2f7d48 clang::FrontendAction::Execute() (/lib/x86_64-linux-gnu/libclang-cpp.so.12+0x1ed1d48)
#31 0x00007fae6d2857d1 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/lib/x86_64-linux-gnu/libclang-cpp.so.12+0x1e5f7d1)
#32 0x00007fae6d35ad62 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/lib/x86_64-linux-gnu/libclang-cpp.so.12+0x1f34d62)
#33 0x00000000004127e2 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/usr/lib/llvm-12/bin/clang+0x4127e2)
#34 0x0000000000410b5e (/usr/lib/llvm-12/bin/clang+0x410b5e)
#35 0x00007fae6cfa16c2 (/lib/x86_64-linux-gnu/libclang-cpp.so.12+0x1b7b6c2)
#36 0x00007fae6675fc4d llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/lib/x86_64-linux-gnu/libLLVM-12.so.1+0xb28c4d)
#37 0x00007fae6cfa0eb9 clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, bool*) const (/lib/x86_64-linux-gnu/libclang-cpp.so.12+0x1b7aeb9)
#38 0x00007fae6cf7646f clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&) const (/lib/x86_64-linux-gnu/libclang-cpp.so.12+0x1b5046f)
#39 0x00007fae6cf76827 clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) const (/lib/x86_64-linux-gnu/libclang-cpp.so.12+0x1b50827)
#40 0x00007fae6cf8b20c clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) (/lib/x86_64-linux-gnu/libclang-cpp.so.12+0x1b6520c)
#41 0x0000000000410434 main (/usr/lib/llvm-12/bin/clang+0x410434)
#42 0x00007fae656ef565 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x28565)
#43 0x000000000040dd1e _start (/usr/lib/llvm-12/bin/clang+0x40dd1e)
clang: error: clang frontend command failed with exit code 139 (use -v to see invocation)
Ubuntu clang version 12.0.0-3ubuntu1~21.04.2
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
clang: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: /tmp/uimain-33df01.cpp
clang: note: diagnostic msg: /tmp/uimain-33df01.sh
clang: note: diagnostic msg: 

********************

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzlWltz4jgW_jXkRQXl--UhD4SQbnYzk1RCT88bJVsyaNrYHslOk_n1cyQbsMwl4TJbu7WpFCGWdPSdT-cmWVFO3m-n_J1lc1TmKM6XBUspwojTFJfsjabvSCxxmqLpN3gmqrSkBLEMlQsm0GQ0HqCv-I2iLC9RyRm0jVIMsky7Zz2YzqBn3PeMYfPp3sUci8XgL1b03PueFSzKshA9ewh94XfOykUVDQAD_JOmb-s__YLnf9C4hH8TACfgb-D7jmMH8G0r0QpRHxTISswygUTMWVEinBFUcAoSYioEwBN5xWNQUIA2f1ZUSHUimuY_NajPj-Ph6xiJKloyEIKiag79i5yXkiUdNrSJgcQ5yPkc_ldzsixOK0KBJooURBTh-EfJcUx71mgfJPlYjsRC5DHDEhevskaPBtxrCUIQqZaFnF09MqApfOb5nOMlwnxeLWlWSnAolgvRs-7gt29aqJ8QhudZLkoWi36cpznv2fc4_YnfBeo_2agvyjYFBFrjerhloP53aQP973QFOsDfghKcgST5iPOco35RLjjFRIohKYtgNHw2AlAfOubAIkuJXFSWVSv4m0d_wKfg0OuhYktYt0FcFIMcdR-h_mQADxpSa3ymVHzdcbAAjU3fh0_HV8pXnAMRqMBcUA6L9oNmqGf5YCXyU0mwdiS4UoocLodJl8jwkooCFk2O_TbZDLX3TG53B4uSV8pqq4zlmbTVFBYXReByjThYRHs4BU7v8tVGNrTZBjJWBvz4CaaeF5gGpjZSLqGGiHdRf3nmLCuVVUxr0wq2nTj-OYPVhkUBR_KkeUFf6SXQSy1CBJ-rwJt5Tl-tSH-eVXXD4-Nvv4DNDEQ-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