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

    <tr>
        <th>Summary</th>
        <td>
            [clang++] Assertion `(NoexceptExpr->isTypeDependent() || NoexceptExpr->getType()->getCanonicalTypeUnqualified() == Context.BoolTy) && "Parser should have made sure that the expression is boolean"' failed.
        </td>
    </tr>

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

This valid code will crash on Clang Assertion Trunk, it seems that this goes back to clang-14:
```cpp
template<typename ...T> void consume(T...);
template<typename ...T> void foo() {
    consume([]() noexcept((sizeof(T))) {} ...);
}
```

Stack dump:
```
clang++: /root/llvm-project/clang/lib/Sema/SemaDeclCXX.cpp:18934: void clang::Sema::checkExceptionSpecification(bool, clang::ExceptionSpecificationType, llvm::ArrayRef<clang::OpaquePtr<clang::QualType> >, llvm::ArrayRef<clang::SourceRange>, clang::Expr*, llvm::SmallVectorImpl<clang::QualType>&, clang::FunctionProtoType::ExceptionSpecInfo&): Assertion `(NoexceptExpr->isTypeDependent() || NoexceptExpr->getType()->getCanonicalTypeUnqualified() == Context.BoolTy) && "Parser should have made sure that the expression is boolean"' 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:40: current parser token '{'
2.      <source>:2:36: parsing function body 'foo'
3.      <source>:2:36: in compound statement ('{}')
4.      <source>:3:13: lambda expression parsing
 #0 0x0000000003ba44f8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3ba44f8)
 #1 0x0000000003ba21bc llvm::sys::CleanupOnSignal(unsigned long) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3ba21bc)
 #2 0x0000000003aef418 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
 #3 0x000075a650042520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #4 0x000075a6500969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
 #5 0x000075a650042476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
 #6 0x000075a6500287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
 #7 0x000075a65002871b (/lib/x86_64-linux-gnu/libc.so.6+0x2871b)
 #8 0x000075a650039e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
 #9 0x0000000006a7d2ea clang::Sema::checkExceptionSpecification(bool, clang::ExceptionSpecificationType, llvm::ArrayRef<clang::OpaquePtr<clang::QualType>>, llvm::ArrayRef<clang::SourceRange>, clang::Expr*, llvm::SmallVectorImpl<clang::QualType>&, clang::FunctionProtoType::ExceptionSpecInfo&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6a7d2ea)
#10 0x00000000074b4361 GetFullTypeForDeclarator((anonymous namespace)::TypeProcessingState&, clang::QualType, clang::TypeSourceInfo*) SemaType.cpp:0:0
#11 0x00000000074b932f clang::Sema::GetTypeForDeclarator(clang::Declarator&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x74b932f)
#12 0x0000000006e9cfa3 clang::Sema::ActOnStartOfLambdaDefinition(clang::LambdaIntroducer&, clang::Declarator&, clang::DeclSpec const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6e9cfa3)
#13 0x00000000066cd878 clang::Parser::ParseLambdaExpressionAfterIntroducer(clang::LambdaIntroducer&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x66cd878)
#14 0x00000000066cec5b clang::Parser::ParseLambdaExpression() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x66cec5b)
#15 0x00000000066ae235 clang::Parser::ParseCastExpression(clang::Parser::CastParseKind, bool, bool&, clang::Parser::TypeCastState, bool, bool*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x66ae235)
#16 0x00000000066aebe7 clang::Parser::ParseCastExpression(clang::Parser::CastParseKind, bool, clang::Parser::TypeCastState, bool, bool*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x66aebe7)
#17 0x00000000066aec79 clang::Parser::ParseAssignmentExpression(clang::Parser::TypeCastState) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x66aec79)
#18 0x00000000066aefde clang::Parser::ParseExpressionList(llvm::SmallVectorImpl<clang::Expr*>&, llvm::function_ref<void ()>, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x66aefde)
#19 0x00000000066b3b52 clang::Parser::ParsePostfixExpressionSuffix(clang::ActionResult<clang::Expr*, true>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x66b3b52)
#20 0x00000000066aca91 clang::Parser::ParseCastExpression(clang::Parser::CastParseKind, bool, bool&, clang::Parser::TypeCastState, bool, bool*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x66aca91)
#21 0x00000000066aebe7 clang::Parser::ParseCastExpression(clang::Parser::CastParseKind, bool, clang::Parser::TypeCastState, bool, bool*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x66aebe7)
#22 0x00000000066aec79 clang::Parser::ParseAssignmentExpression(clang::Parser::TypeCastState) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x66aec79)
#23 0x00000000066b3699 clang::Parser::ParseExpression(clang::Parser::TypeCastState) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x66b3699)
#24 0x0000000006736429 clang::Parser::ParseExprStatement(clang::Parser::ParsedStmtContext) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6736429)
#25 0x000000000672c7fc 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+++0x672c7fc)
#26 0x000000000672d710 clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x672d710)
#27 0x000000000672e5e5 clang::Parser::ParseCompoundStatementBody(bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x672e5e5)
#28 0x000000000672fd3a clang::Parser::ParseFunctionStatementBody(clang::Decl*, clang::Parser::ParseScope&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x672fd3a)
#29 0x0000000006642b93 clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6642b93)
#30 0x0000000006677f9d 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+++0x6677f9d)
#31 0x00000000067416d6 clang::Parser::ParseDeclarationAfterTemplate(clang::DeclaratorContext, clang::Parser::ParsedTemplateInfo&, clang::ParsingDeclRAIIObject&, clang::SourceLocation&, clang::ParsedAttributes&, clang::AccessSpecifier) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x67416d6)
#32 0x000000000674ef9c clang::Parser::ParseTemplateDeclarationOrSpecialization(clang::DeclaratorContext, clang::SourceLocation&, clang::ParsedAttributes&, clang::AccessSpecifier) (.part.0) ParseTemplate.cpp:0:0
#33 0x000000000674f2ba clang::Parser::ParseDeclarationStartingWithTemplate(clang::DeclaratorContext, clang::SourceLocation&, clang::ParsedAttributes&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x674f2ba)
#34 0x0000000006680543 clang::Parser::ParseDeclaration(clang::DeclaratorContext, clang::SourceLocation&, clang::ParsedAttributes&, clang::ParsedAttributes&, clang::SourceLocation*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6680543)
#35 0x000000000663e877 clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x663e877)
#36 0x000000000663f71d clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x663f71d)
#37 0x0000000006631c3a clang::ParseAST(clang::Sema&, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6631c3a)
#38 0x00000000044fcb58 clang::CodeGenAction::ExecuteAction() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x44fcb58)
#39 0x00000000047b6459 clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x47b6459)
#40 0x0000000004734ffe clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4734ffe)
#41 0x000000000489bf4e clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x489bf4e)
#42 0x0000000000cda85f cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xcda85f)
#43 0x0000000000cd256a ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) driver.cpp:0:0
#44 0x0000000004540829 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
#45 0x0000000003aef8c4 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3aef8c4)
#46 0x0000000004540e1f 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
#47 0x000000000450675d clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x450675d)
#48 0x000000000450784d 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+++0x450784d)
#49 0x000000000450f175 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x450f175)
#50 0x0000000000cd772f clang_main(int, char**, llvm::ToolContext const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xcd772f)
#51 0x0000000000ba7084 main (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xba7084)
#52 0x000075a650029d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#53 0x000075a650029e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#54 0x0000000000cd201e _start (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xcd201e)
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/eJzsW99z46iW_muUF8ouCcn68ZAHt5P0ZrZ3O9vO7t63FEJHNtMy6ALKOP3XbwGyIxTbSbrirpmd25VObAkO3_dxOBwQIkqxFQe4DGafgtnVBen0WsjLJ_Y74UmezC5KUT1dBnge4Pn9mimkQWlKFCCm0Ao4SKKhQuUTIqjufvwAOXWFg_AqCPvfC7FpWQMSXW_bRkiQQTxHwezTWutWBfE8wDcBvlmJqhSNngq5CvDNjwDf1Hz7-_r36PNjMLsKcP724rgYNm9xP5KGVYiKCtAfrGkQlUStkeBo0RC-QnOlQGomOLqXHf8e4AViGimAjUJ6TTTSxshKgEIlod-RFoiaipMoMYhca2nofmjbuisaNm1DNATxQj-1wMkG0HQ6vQ_ia_QoLB6uug0EOL-fTqcGd_zpjVVrIQKcB7hAQdbXQQgNLLoe7ctwAVsKrbZfc8V-gKhNq6ZJ-2OtZFdoBCPIrkbkhsoutdGi6jbtSxHcVytSgD-ZH9Pp-EYKoQN80zSPm0krxe9Azde-3E3DygDfLGFD-j9XQJvFP_4xNZrG8ygvYiN4r56tFM-DeG5r2E90DfT7tSXLBF-2QFnNKDFfApyXQjSmcwdVD5e9f2rBFDQ4Xbm5lOTpG9RBvBjU_tqSf3Zwp6V_-b860lgT8TUK4uu3WFqKTlL4RvgK-hoeyFbagTW0s9yQpvkfoFrI203bHEUQ4HRk7qbj1LC8k0ILV-qFFLe8FrZmYQR_HiCmb3H-n71DGWCTIL5mypi5ghZ4BVzvXXMRZAs0LrwC7fQ1hfoLC8IFZ9SB_m_-z440rGZQ7SzFV0F8hRaCa9jq6Schmvsne8NATFGA8R2RCiRSa9E1FVqTR0AbUgFSnYTdIAYE21aCUoYJU8j4AxAeYBzgDNWENVBNnevefbmeL6-R6soN04igslshCa2Q2oz-UTBiet2VUyo2vWu_9HCmVAcqwDeI8AoxTpuuAovIhSITVrQ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