llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.31k stars 11.69k forks source link

[clang]: clang crashed with `Assertion 'D->getCachedLinkage() == LV.getLinkage()' failed` in `clang::LinkageComputer::getLVForDecl` when try to return a lambda with another lambda inside its trailing noexcept specifier #97587

Open RungeCC opened 3 months ago

RungeCC commented 3 months ago

Reproducer (See online compiler: https://godbolt.org/z/5srGToPG6)

// clang++ -std=c++26 main.cpp
template <class CallableT>
struct lambda {
    CallableT storage;
};

constexpr auto clang_ice(auto func) noexcept {
    return []() noexcept(noexcept(lambda{
        []{}
    })) { return; };
}

int main() { (void)(clang_ice(1)()); }

Assertion:

clang-19: /root/llvm-project/clang/lib/AST/Decl.cpp:1575: clang::LinkageInfo clang::LinkageComputer::getLVForDecl(const clang::NamedDecl*, clang::LVComputationKind): Assertion `D->getCachedLinkage() == LV.getLinkage()' failed.

Stacktrace:

 #0 0x0000000003a36d28 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk-20240703/bin/clang-19+0x3a36d28)
 #1 0x0000000003a3448c SignalHandler(int) Signals.cpp:0:0
 #2 0x000071474e442520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #3 0x000071474e4969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
 #4 0x000071474e442476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
 #5 0x000071474e4287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
 #6 0x000071474e42871b (/lib/x86_64-linux-gnu/libc.so.6+0x2871b)
 #7 0x000071474e439e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
 #8 0x0000000007665cd5 clang::LinkageComputer::getLVForDecl(clang::NamedDecl const*, clang::LVComputationKind) (/opt/compiler-explorer/clang-assertions-trunk-20240703/bin/clang-19+0x7665cd5)
 #9 0x0000000007668255 clang::LinkageComputer::getLVForClassMember(clang::NamedDecl const*, clang::LVComputationKind, bool) (/opt/compiler-explorer/clang-assertions-trunk-20240703/bin/clang-19+0x7668255)
#10 0x0000000007669062 clang::LinkageComputer::computeLVForDecl(clang::NamedDecl const*, clang::LVComputationKind, bool) (/opt/compiler-explorer/clang-assertions-trunk-20240703/bin/clang-19+0x7669062)
#11 0x00000000076659a9 clang::LinkageComputer::getLVForDecl(clang::NamedDecl const*, clang::LVComputationKind) (/opt/compiler-explorer/clang-assertions-trunk-20240703/bin/clang-19+0x76659a9)
#12 0x0000000007665f11 clang::NamedDecl::getLinkageAndVisibility() const (/opt/compiler-explorer/clang-assertions-trunk-20240703/bin/clang-19+0x7665f11)
#13 0x0000000003e68f40 clang::CodeGen::CodeGenModule::SetFunctionAttributes(clang::GlobalDecl, llvm::Function*, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk-20240703/bin/clang-19+0x3e68f40)
#14 0x0000000003e6bfc0 clang::CodeGen::CodeGenModule::GetOrCreateLLVMFunction(llvm::StringRef, llvm::Type*, clang::GlobalDecl, bool, bool, bool, llvm::AttributeList, clang::CodeGen::ForDefinition_t) (/opt/compiler-explorer/clang-assertions-trunk-20240703/bin/clang-19+0x3e6bfc0)
#15 0x0000000003e6ecf8 clang::CodeGen::CodeGenModule::GetAddrOfFunction(clang::GlobalDecl, llvm::Type*, bool, bool, clang::CodeGen::ForDefinition_t) (/opt/compiler-explorer/clang-assertions-trunk-20240703/bin/clang-19+0x3e6ecf8)
#16 0x00000000041d2ee6 clang::CodeGen::CodeGenFunction::EmitCXXMemberOrOperatorMemberCallExpr(clang::CallExpr const*, clang::CXXMethodDecl const*, clang::CodeGen::ReturnValueSlot, bool, clang::NestedNameSpecifier*, bool, clang::Expr const*) (/opt/compiler-explorer/clang-assertions-trunk-20240703/bin/clang-19+0x41d2ee6)
#17 0x00000000041d34da clang::CodeGen::CodeGenFunction::EmitCXXOperatorMemberCallExpr(clang::CXXOperatorCallExpr const*, clang::CXXMethodDecl const*, clang::CodeGen::ReturnValueSlot) (/opt/compiler-explorer/clang-assertions-trunk-20240703/bin/clang-19+0x41d34da)
#18 0x00000000041b7b53 clang::CodeGen::CodeGenFunction::EmitCallExpr(clang::CallExpr const*, clang::CodeGen::ReturnValueSlot) (/opt/compiler-explorer/clang-assertions-trunk-20240703/bin/clang-19+0x41b7b53)
#19 0x0000000004205291 (anonymous namespace)::ScalarExprEmitter::VisitCallExpr(clang::CallExpr const*) CGExprScalar.cpp:0:0
#20 0x00000000041fc060 clang::StmtVisitorBase<std::add_pointer, (anonymous namespace)::ScalarExprEmitter, llvm::Value*>::Visit(clang::Stmt*) CGExprScalar.cpp:0:0
#21 0x00000000041fe04b (anonymous namespace)::ScalarExprEmitter::Visit(clang::Expr*) CGExprScalar.cpp:0:0
#22 0x00000000041fc3cb clang::StmtVisitorBase<std::add_pointer, (anonymous namespace)::ScalarExprEmitter, llvm::Value*>::Visit(clang::Stmt*) CGExprScalar.cpp:0:0
#23 0x0000000004201dfc clang::CodeGen::CodeGenFunction::EmitScalarExpr(clang::Expr const*, bool) (/opt/compiler-explorer/clang-assertions-trunk-20240703/bin/clang-19+0x4201dfc)
#24 0x000000000419099e clang::CodeGen::CodeGenFunction::EmitAnyExpr(clang::Expr const*, clang::CodeGen::AggValueSlot, bool) (/opt/compiler-explorer/clang-assertions-trunk-20240703/bin/clang-19+0x419099e)
#25 0x00000000041b315d clang::CodeGen::CodeGenFunction::EmitIgnoredExpr(clang::Expr const*) (/opt/compiler-explorer/clang-assertions-trunk-20240703/bin/clang-19+0x41b315d)
#26 0x0000000004204227 (anonymous namespace)::ScalarExprEmitter::VisitCastExpr(clang::CastExpr*) CGExprScalar.cpp:0:0
#27 0x00000000041fc053 clang::StmtVisitorBase<std::add_pointer, (anonymous namespace)::ScalarExprEmitter, llvm::Value*>::Visit(clang::Stmt*) CGExprScalar.cpp:0:0
#28 0x00000000042089d2 (anonymous namespace)::ScalarExprEmitter::VisitExprWithCleanups(clang::ExprWithCleanups*) CGExprScalar.cpp:0:0
#29 0x00000000041fc835 clang::StmtVisitorBase<std::add_pointer, (anonymous namespace)::ScalarExprEmitter, llvm::Value*>::Visit(clang::Stmt*) CGExprScalar.cpp:0:0
#30 0x0000000004201dfc clang::CodeGen::CodeGenFunction::EmitScalarExpr(clang::Expr const*, bool) (/opt/compiler-explorer/clang-assertions-trunk-20240703/bin/clang-19+0x4201dfc)
#31 0x000000000419099e clang::CodeGen::CodeGenFunction::EmitAnyExpr(clang::Expr const*, clang::CodeGen::AggValueSlot, bool) (/opt/compiler-explorer/clang-assertions-trunk-20240703/bin/clang-19+0x419099e)
#32 0x00000000041b315d clang::CodeGen::CodeGenFunction::EmitIgnoredExpr(clang::Expr const*) (/opt/compiler-explorer/clang-assertions-trunk-20240703/bin/clang-19+0x41b315d)
#33 0x0000000003d8f875 clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*, llvm::ArrayRef<clang::Attr const*>) (/opt/compiler-explorer/clang-assertions-trunk-20240703/bin/clang-19+0x3d8f875)
#34 0x0000000003d974bc clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt const&, bool, clang::CodeGen::AggValueSlot) (/opt/compiler-explorer/clang-assertions-trunk-20240703/bin/clang-19+0x3d974bc)
#35 0x0000000003dfad06 clang::CodeGen::CodeGenFunction::EmitFunctionBody(clang::Stmt const*) (/opt/compiler-explorer/clang-assertions-trunk-20240703/bin/clang-19+0x3dfad06)
#36 0x0000000003e0f61d clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl, llvm::Function*, clang::CodeGen::CGFunctionInfo const&) (/opt/compiler-explorer/clang-assertions-trunk-20240703/bin/clang-19+0x3e0f61d)
#37 0x0000000003e6f172 clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl, llvm::GlobalValue*) (/opt/compiler-explorer/clang-assertions-trunk-20240703/bin/clang-19+0x3e6f172)
#38 0x0000000003e6a135 clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl, llvm::GlobalValue*) (/opt/compiler-explorer/clang-assertions-trunk-20240703/bin/clang-19+0x3e6a135)
#39 0x0000000003e6a763 clang::CodeGen::CodeGenModule::EmitGlobal(clang::GlobalDecl) (/opt/compiler-explorer/clang-assertions-trunk-20240703/bin/clang-19+0x3e6a763)
#40 0x0000000003e74503 clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*) (.part.0) CodeGenModule.cpp:0:0
#41 0x00000000043254f6 (anonymous namespace)::CodeGeneratorImpl::HandleTopLevelDecl(clang::DeclGroupRef) ModuleBuilder.cpp:0:0
#42 0x0000000004315658 clang::BackendConsumer::HandleTopLevelDecl(clang::DeclGroupRef) (/opt/compiler-explorer/clang-assertions-trunk-20240703/bin/clang-19+0x4315658)
#43 0x00000000063bda14 clang::ParseAST(clang::Sema&, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk-20240703/bin/clang-19+0x63bda14)
#44 0x0000000004323018 clang::CodeGenAction::ExecuteAction() (/opt/compiler-explorer/clang-assertions-trunk-20240703/bin/clang-19+0x4323018)
#45 0x00000000045aa249 clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-assertions-trunk-20240703/bin/clang-19+0x45aa249)
#46 0x000000000453026e clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/compiler-explorer/clang-assertions-trunk-20240703/bin/clang-19+0x453026e)
#47 0x000000000469277e clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-assertions-trunk-20240703/bin/clang-19+0x469277e)
#48 0x0000000000c709b5 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/compiler-explorer/clang-assertions-trunk-20240703/bin/clang-19+0xc709b5)
#49 0x0000000000c69bda ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) driver.cpp:0:0
#50 0x0000000000c6d50e clang_main(int, char**, llvm::ToolContext const&) (/opt/compiler-explorer/clang-assertions-trunk-20240703/bin/clang-19+0xc6d50e)
#51 0x0000000000b45ff4 main (/opt/compiler-explorer/clang-assertions-trunk-20240703/bin/clang-19+0xb45ff4)
#52 0x000071474e429d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#53 0x000071474e429e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#54 0x0000000000c6968e _start (/opt/compiler-explorer/clang-assertions-trunk-20240703/bin/clang-19+0xc6968e)
clang++: error: unable to execute command: Aborted (core dumped)
clang++: error: clang frontend command failed due to signal (use -v to see invocation)

Note:

llvmbot commented 3 months ago

@llvm/issue-subscribers-clang-codegen

Author: Runge (RungeCC)

Reproducer (See online compiler: https://godbolt.org/z/5srGToPG6) ```c++ // clang++ -std=c++26 main.cpp template <class CallableT> struct lambda { CallableT storage; }; constexpr auto clang_ice(auto func) noexcept { return []() noexcept(noexcept(lambda{ []{} })) { return; }; } int main() { (void)(clang_ice(1)()); } ``` - clang version: trunk with assertion (clang trunk without assertion did not crash). Assertion: ``` clang-19: /root/llvm-project/clang/lib/AST/Decl.cpp:1575: clang::LinkageInfo clang::LinkageComputer::getLVForDecl(const clang::NamedDecl*, clang::LVComputationKind): Assertion `D->getCachedLinkage() == LV.getLinkage()' failed. ``` Stacktrace: ``` #0 0x0000000003a36d28 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk-20240703/bin/clang-19+0x3a36d28) #1 0x0000000003a3448c SignalHandler(int) Signals.cpp:0:0 #2 0x000071474e442520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520) #3 0x000071474e4969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc) #4 0x000071474e442476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476) #5 0x000071474e4287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3) #6 0x000071474e42871b (/lib/x86_64-linux-gnu/libc.so.6+0x2871b) #7 0x000071474e439e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96) #8 0x0000000007665cd5 clang::LinkageComputer::getLVForDecl(clang::NamedDecl const*, clang::LVComputationKind) (/opt/compiler-explorer/clang-assertions-trunk-20240703/bin/clang-19+0x7665cd5) #9 0x0000000007668255 clang::LinkageComputer::getLVForClassMember(clang::NamedDecl const*, clang::LVComputationKind, bool) (/opt/compiler-explorer/clang-assertions-trunk-20240703/bin/clang-19+0x7668255) #10 0x0000000007669062 clang::LinkageComputer::computeLVForDecl(clang::NamedDecl const*, clang::LVComputationKind, bool) (/opt/compiler-explorer/clang-assertions-trunk-20240703/bin/clang-19+0x7669062) #11 0x00000000076659a9 clang::LinkageComputer::getLVForDecl(clang::NamedDecl const*, clang::LVComputationKind) (/opt/compiler-explorer/clang-assertions-trunk-20240703/bin/clang-19+0x76659a9) #12 0x0000000007665f11 clang::NamedDecl::getLinkageAndVisibility() const (/opt/compiler-explorer/clang-assertions-trunk-20240703/bin/clang-19+0x7665f11) #13 0x0000000003e68f40 clang::CodeGen::CodeGenModule::SetFunctionAttributes(clang::GlobalDecl, llvm::Function*, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk-20240703/bin/clang-19+0x3e68f40) #14 0x0000000003e6bfc0 clang::CodeGen::CodeGenModule::GetOrCreateLLVMFunction(llvm::StringRef, llvm::Type*, clang::GlobalDecl, bool, bool, bool, llvm::AttributeList, clang::CodeGen::ForDefinition_t) (/opt/compiler-explorer/clang-assertions-trunk-20240703/bin/clang-19+0x3e6bfc0) #15 0x0000000003e6ecf8 clang::CodeGen::CodeGenModule::GetAddrOfFunction(clang::GlobalDecl, llvm::Type*, bool, bool, clang::CodeGen::ForDefinition_t) (/opt/compiler-explorer/clang-assertions-trunk-20240703/bin/clang-19+0x3e6ecf8) #16 0x00000000041d2ee6 clang::CodeGen::CodeGenFunction::EmitCXXMemberOrOperatorMemberCallExpr(clang::CallExpr const*, clang::CXXMethodDecl const*, clang::CodeGen::ReturnValueSlot, bool, clang::NestedNameSpecifier*, bool, clang::Expr const*) (/opt/compiler-explorer/clang-assertions-trunk-20240703/bin/clang-19+0x41d2ee6) #17 0x00000000041d34da clang::CodeGen::CodeGenFunction::EmitCXXOperatorMemberCallExpr(clang::CXXOperatorCallExpr const*, clang::CXXMethodDecl const*, clang::CodeGen::ReturnValueSlot) (/opt/compiler-explorer/clang-assertions-trunk-20240703/bin/clang-19+0x41d34da) #18 0x00000000041b7b53 clang::CodeGen::CodeGenFunction::EmitCallExpr(clang::CallExpr const*, clang::CodeGen::ReturnValueSlot) (/opt/compiler-explorer/clang-assertions-trunk-20240703/bin/clang-19+0x41b7b53) #19 0x0000000004205291 (anonymous namespace)::ScalarExprEmitter::VisitCallExpr(clang::CallExpr const*) CGExprScalar.cpp:0:0 #20 0x00000000041fc060 clang::StmtVisitorBase<std::add_pointer, (anonymous namespace)::ScalarExprEmitter, llvm::Value*>::Visit(clang::Stmt*) CGExprScalar.cpp:0:0 #21 0x00000000041fe04b (anonymous namespace)::ScalarExprEmitter::Visit(clang::Expr*) CGExprScalar.cpp:0:0 #22 0x00000000041fc3cb clang::StmtVisitorBase<std::add_pointer, (anonymous namespace)::ScalarExprEmitter, llvm::Value*>::Visit(clang::Stmt*) CGExprScalar.cpp:0:0 #23 0x0000000004201dfc clang::CodeGen::CodeGenFunction::EmitScalarExpr(clang::Expr const*, bool) (/opt/compiler-explorer/clang-assertions-trunk-20240703/bin/clang-19+0x4201dfc) #24 0x000000000419099e clang::CodeGen::CodeGenFunction::EmitAnyExpr(clang::Expr const*, clang::CodeGen::AggValueSlot, bool) (/opt/compiler-explorer/clang-assertions-trunk-20240703/bin/clang-19+0x419099e) #25 0x00000000041b315d clang::CodeGen::CodeGenFunction::EmitIgnoredExpr(clang::Expr const*) (/opt/compiler-explorer/clang-assertions-trunk-20240703/bin/clang-19+0x41b315d) #26 0x0000000004204227 (anonymous namespace)::ScalarExprEmitter::VisitCastExpr(clang::CastExpr*) CGExprScalar.cpp:0:0 #27 0x00000000041fc053 clang::StmtVisitorBase<std::add_pointer, (anonymous namespace)::ScalarExprEmitter, llvm::Value*>::Visit(clang::Stmt*) CGExprScalar.cpp:0:0 #28 0x00000000042089d2 (anonymous namespace)::ScalarExprEmitter::VisitExprWithCleanups(clang::ExprWithCleanups*) CGExprScalar.cpp:0:0 #29 0x00000000041fc835 clang::StmtVisitorBase<std::add_pointer, (anonymous namespace)::ScalarExprEmitter, llvm::Value*>::Visit(clang::Stmt*) CGExprScalar.cpp:0:0 #30 0x0000000004201dfc clang::CodeGen::CodeGenFunction::EmitScalarExpr(clang::Expr const*, bool) (/opt/compiler-explorer/clang-assertions-trunk-20240703/bin/clang-19+0x4201dfc) #31 0x000000000419099e clang::CodeGen::CodeGenFunction::EmitAnyExpr(clang::Expr const*, clang::CodeGen::AggValueSlot, bool) (/opt/compiler-explorer/clang-assertions-trunk-20240703/bin/clang-19+0x419099e) #32 0x00000000041b315d clang::CodeGen::CodeGenFunction::EmitIgnoredExpr(clang::Expr const*) (/opt/compiler-explorer/clang-assertions-trunk-20240703/bin/clang-19+0x41b315d) #33 0x0000000003d8f875 clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*, llvm::ArrayRef<clang::Attr const*>) (/opt/compiler-explorer/clang-assertions-trunk-20240703/bin/clang-19+0x3d8f875) #34 0x0000000003d974bc clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt const&, bool, clang::CodeGen::AggValueSlot) (/opt/compiler-explorer/clang-assertions-trunk-20240703/bin/clang-19+0x3d974bc) #35 0x0000000003dfad06 clang::CodeGen::CodeGenFunction::EmitFunctionBody(clang::Stmt const*) (/opt/compiler-explorer/clang-assertions-trunk-20240703/bin/clang-19+0x3dfad06) #36 0x0000000003e0f61d clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl, llvm::Function*, clang::CodeGen::CGFunctionInfo const&) (/opt/compiler-explorer/clang-assertions-trunk-20240703/bin/clang-19+0x3e0f61d) #37 0x0000000003e6f172 clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl, llvm::GlobalValue*) (/opt/compiler-explorer/clang-assertions-trunk-20240703/bin/clang-19+0x3e6f172) #38 0x0000000003e6a135 clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl, llvm::GlobalValue*) (/opt/compiler-explorer/clang-assertions-trunk-20240703/bin/clang-19+0x3e6a135) #39 0x0000000003e6a763 clang::CodeGen::CodeGenModule::EmitGlobal(clang::GlobalDecl) (/opt/compiler-explorer/clang-assertions-trunk-20240703/bin/clang-19+0x3e6a763) #40 0x0000000003e74503 clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*) (.part.0) CodeGenModule.cpp:0:0 #41 0x00000000043254f6 (anonymous namespace)::CodeGeneratorImpl::HandleTopLevelDecl(clang::DeclGroupRef) ModuleBuilder.cpp:0:0 #42 0x0000000004315658 clang::BackendConsumer::HandleTopLevelDecl(clang::DeclGroupRef) (/opt/compiler-explorer/clang-assertions-trunk-20240703/bin/clang-19+0x4315658) #43 0x00000000063bda14 clang::ParseAST(clang::Sema&, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk-20240703/bin/clang-19+0x63bda14) #44 0x0000000004323018 clang::CodeGenAction::ExecuteAction() (/opt/compiler-explorer/clang-assertions-trunk-20240703/bin/clang-19+0x4323018) #45 0x00000000045aa249 clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-assertions-trunk-20240703/bin/clang-19+0x45aa249) #46 0x000000000453026e clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/compiler-explorer/clang-assertions-trunk-20240703/bin/clang-19+0x453026e) #47 0x000000000469277e clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-assertions-trunk-20240703/bin/clang-19+0x469277e) #48 0x0000000000c709b5 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/compiler-explorer/clang-assertions-trunk-20240703/bin/clang-19+0xc709b5) #49 0x0000000000c69bda ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) driver.cpp:0:0 #50 0x0000000000c6d50e clang_main(int, char**, llvm::ToolContext const&) (/opt/compiler-explorer/clang-assertions-trunk-20240703/bin/clang-19+0xc6d50e) #51 0x0000000000b45ff4 main (/opt/compiler-explorer/clang-assertions-trunk-20240703/bin/clang-19+0xb45ff4) #52 0x000071474e429d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90) #53 0x000071474e429e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40) #54 0x0000000000c6968e _start (/opt/compiler-explorer/clang-assertions-trunk-20240703/bin/clang-19+0xc6968e) clang++: error: unable to execute command: Aborted (core dumped) clang++: error: clang frontend command failed due to signal (use -v to see invocation) ``` Note: - It seems that it's necessary to have `lambda{...}` inside `noexcept(noexcept(...))` for triggering this ICE. - Additionally, it's known that there's another ICE in clang (related to name mangling): [#70064](https://github.com/llvm/llvm-project/issues/70064) which is pretty similar to this (maybe actually unrelated). - No ICE without assertion, so perhaps the assertion turned out to be a false positive
shafik commented 3 months ago

Comfirmed