Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assertion allLookupResultsAreTheSame failure on code with C++ Modules #122328

Open
MikailBag opened this issue Jan 9, 2025 · 1 comment
Open
Assignees
Labels
clang:modules C++20 modules and Clang Header Modules crash Prefer [crash-on-valid] or [crash-on-invalid]

Comments

@MikailBag
Copy link

Code (https://gist.github.com/MikailBag/75ff72a9e3cd7e4ef9dbdeb5523c4ca9)
I can't provide a single preprocessed source file, since code uses modules.

This code is likely invalid (each file contains independently reduced copy of std and stdexec so some ODR violations were bound to occur; in particular __make_sexpr_t struct has different definitions in TUs; Xclang -fno-skip-odr-check-in-gmf gives errors as well).

I get the following error

clang-20: /home/mb/projects/llvm-project/clang/lib/AST/DeclCXX.cpp:1650: NamedDecl *getLambdaCallOperatorHelper(const CXXRecordDecl &): Assertion `allLookupResultsAreTheSame(Calls) && "More than one lambda call operator!"' 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: /home/mb/projects/llvm-project/build/bin/clang-20 -cc1 -triple x86_64-unknown-linux-gnu -emit-module-interface -disable-free -clear-ast-before-backend -main-file-name file2.cpp -mrelocation-model pic -pic-level 2 -pic-is-pie -mframe-pointer=all -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fdebug-compilation-dir=/home/mb/projects/temp -fcoverage-compilation-dir=/home/mb/projects/temp -resource-dir /home/mb/projects/llvm-project/build/lib/clang/20 -internal-isystem /home/mb/projects/llvm-project/build/bin/../include/x86_64-unknown-linux-gnu/c++/v1 -internal-isystem /home/mb/projects/llvm-project/build/bin/../include/c++/v1 -internal-isystem /home/mb/projects/llvm-project/build/lib/clang/20/include -internal-isystem /usr/local/include -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/14/../../../../x86_64-linux-gnu/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -Wall -Wextra -Wpedantic -std=c++23 -fdeprecated-macro -ferror-limit 19 -fgnuc-version=4.2.1 -fno-implicit-modules -fmodule-file=util=util.pcm -fskip-odr-check-in-gmf -fcxx-exceptions -fexceptions -fcolor-diagnostics -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o out.pcm -x c++ /home/mb/projects/temp/file2.cpp
1.	<eof> parser at end of file
2.	/home/mb/projects/temp/file2.cpp:28:8: instantiating function definition 'stdexec::__make_sexpr_t<stdexec::just_t>::operator()<int>'
3.	/home/mb/projects/temp/file2.cpp:19:40: instantiating class definition 'stdexec::__sexpr<(lambda at /home/mb/projects/temp/file2.cpp:24:28){}>'
4.	/home/mb/projects/temp/file2.cpp:12:28: instantiating function definition 'stdexec::__detail::(anonymous class)::operator()<stdexec::__detail::(lambda at /home/mb/projects/temp/file2.cpp:11:20) (*)()>'
 #0 0x00005bb7f8d1e918 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/home/mb/projects/llvm-project/build/bin/clang-20+0x3e92918)
 #1 0x00005bb7f8d1c3ce llvm::sys::RunSignalHandlers() (/home/mb/projects/llvm-project/build/bin/clang-20+0x3e903ce)
 #2 0x00005bb7f8d1f108 SignalHandler(int) Signals.cpp:0:0
 #3 0x00007b60b2445320 (/lib/x86_64-linux-gnu/libc.so.6+0x45320)
 #4 0x00007b60b249eb1c __pthread_kill_implementation ./nptl/pthread_kill.c:44:76
 #5 0x00007b60b249eb1c __pthread_kill_internal ./nptl/pthread_kill.c:78:10
 #6 0x00007b60b249eb1c pthread_kill ./nptl/pthread_kill.c:89:10
 #7 0x00007b60b244526e raise ./signal/../sysdeps/posix/raise.c:27:6
 #8 0x00007b60b24288ff abort ./stdlib/abort.c:81:7
 #9 0x00007b60b242881b _nl_load_domain ./intl/loadmsgcat.c:1177:9
#10 0x00007b60b243b507 (/lib/x86_64-linux-gnu/libc.so.6+0x3b507)
#11 0x00005bb7fb88ac27 getLambdaCallOperatorHelper(clang::CXXRecordDecl const&) DeclCXX.cpp:0:0
#12 0x00005bb7fb88ac56 clang::CXXRecordDecl::getLambdaCallOperator() const (/home/mb/projects/llvm-project/build/bin/clang-20+0x69fec56)
#13 0x00005bb7fb9f001f clang::LambdaExpr::isMutable() const (/home/mb/projects/llvm-project/build/bin/clang-20+0x6b6401f)
#14 0x00005bb7fb433a90 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformLambdaExpr(clang::LambdaExpr*) SemaTemplateInstantiate.cpp:0:0
#15 0x00005bb7fb4236d3 (anonymous namespace)::TemplateInstantiator::TransformLambdaExpr(clang::LambdaExpr*) SemaTemplateInstantiate.cpp:0:0
#16 0x00005bb7fb3dfd18 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformStmt(clang::Stmt*, clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::StmtDiscardKind) SemaTemplateInstantiate.cpp:0:0
#17 0x00005bb7fb42d7a8 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformCompoundStmt(clang::CompoundStmt*, bool) SemaTemplateInstantiate.cpp:0:0
#18 0x00005bb7fb3dfcaa clang::Sema::SubstStmt(clang::Stmt*, clang::MultiLevelTemplateArgumentList const&) (/home/mb/projects/llvm-project/build/bin/clang-20+0x6553caa)
#19 0x00005bb7fb4715e8 clang::Sema::InstantiateFunctionDefinition(clang::SourceLocation, clang::FunctionDecl*, bool, bool, bool) (/home/mb/projects/llvm-project/build/bin/clang-20+0x65e55e8)
#20 0x00005bb7f97632cf clang::StackExhaustionHandler::runWithSufficientStackSpace(clang::SourceLocation, llvm::function_ref<void ()>) (/home/mb/projects/llvm-project/build/bin/clang-20+0x48d72cf)
#21 0x00005bb7fb34857c clang::Sema::DeduceReturnType(clang::FunctionDecl*, clang::SourceLocation, bool) (/home/mb/projects/llvm-project/build/bin/clang-20+0x64bc57c)
#22 0x00005bb7faec606e clang::Sema::DiagnoseUseOfDecl(clang::NamedDecl*, llvm::ArrayRef<clang::SourceLocation>, clang::ObjCInterfaceDecl const*, bool, bool, clang::ObjCInterfaceDecl*, bool) (/home/mb/projects/llvm-project/build/bin/clang-20+0x603a06e)
#23 0x00005bb7fb24a1e3 CreateFunctionRefExpr(clang::Sema&, clang::FunctionDecl*, clang::NamedDecl*, clang::Expr const*, bool, clang::SourceLocation, clang::DeclarationNameLoc const&) SemaOverload.cpp:0:0
#24 0x00005bb7fb2532ac clang::Sema::BuildCallToObjectOfClassType(clang::Scope*, clang::Expr*, clang::SourceLocation, llvm::MutableArrayRef<clang::Expr*>, clang::SourceLocation) (/home/mb/projects/llvm-project/build/bin/clang-20+0x63c72ac)
#25 0x00005bb7faecc631 clang::Sema::BuildCallExpr(clang::Scope*, clang::Expr*, clang::SourceLocation, llvm::MutableArrayRef<clang::Expr*>, clang::SourceLocation, clang::Expr*, bool, bool) (/home/mb/projects/llvm-project/build/bin/clang-20+0x6040631)
#26 0x00005bb7faee35bb clang::Sema::ActOnCallExpr(clang::Scope*, clang::Expr*, clang::SourceLocation, llvm::MutableArrayRef<clang::Expr*>, clang::SourceLocation, clang::Expr*) (/home/mb/projects/llvm-project/build/bin/clang-20+0x60575bb)
#27 0x00005bb7fb42658f clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformCallExpr(clang::CallExpr*) SemaTemplateInstantiate.cpp:0:0
#28 0x00005bb7fb43a1db clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformDecltypeType(clang::TypeLocBuilder&, clang::DecltypeTypeLoc) SemaTemplateInstantiate.cpp:0:0
#29 0x00005bb7fb3d85e2 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformType(clang::TypeLocBuilder&, clang::TypeLoc) SemaTemplateInstantiate.cpp:0:0
#30 0x00005bb7fb3d7c46 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformType(clang::TypeSourceInfo*) SemaTemplateInstantiate.cpp:0:0
#31 0x00005bb7fb3d8812 clang::Sema::SubstType(clang::QualType, clang::MultiLevelTemplateArgumentList const&, clang::SourceLocation, clang::DeclarationName, bool*) (/home/mb/projects/llvm-project/build/bin/clang-20+0x654c812)
#32 0x00005bb7fb2afe73 clang::Sema::CheckTemplateIdType(clang::TemplateName, clang::SourceLocation, clang::TemplateArgumentListInfo&) (/home/mb/projects/llvm-project/build/bin/clang-20+0x6423e73)
#33 0x00005bb7fb436a5d clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformTemplateSpecializationType(clang::TypeLocBuilder&, clang::TemplateSpecializationTypeLoc, clang::TemplateName) SemaTemplateInstantiate.cpp:0:0
#34 0x00005bb7fb43fab0 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformTemplateSpecializationType(clang::TypeLocBuilder&, clang::TemplateSpecializationTypeLoc) SemaTemplateInstantiate.cpp:0:0
#35 0x00005bb7fb3d817a clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformType(clang::TypeLocBuilder&, clang::TypeLoc) SemaTemplateInstantiate.cpp:0:0
#36 0x00005bb7fb43c1e5 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformElaboratedType(clang::TypeLocBuilder&, clang::ElaboratedTypeLoc) SemaTemplateInstantiate.cpp:0:0
#37 0x00005bb7fb3d8243 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformType(clang::TypeLocBuilder&, clang::TypeLoc) SemaTemplateInstantiate.cpp:0:0
#38 0x00005bb7fb3d7c46 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformType(clang::TypeSourceInfo*) SemaTemplateInstantiate.cpp:0:0
#39 0x00005bb7fb3d8812 clang::Sema::SubstType(clang::QualType, clang::MultiLevelTemplateArgumentList const&, clang::SourceLocation, clang::DeclarationName, bool*) (/home/mb/projects/llvm-project/build/bin/clang-20+0x654c812)
#40 0x00005bb7fb2afe73 clang::Sema::CheckTemplateIdType(clang::TemplateName, clang::SourceLocation, clang::TemplateArgumentListInfo&) (/home/mb/projects/llvm-project/build/bin/clang-20+0x6423e73)
#41 0x00005bb7fb436a5d clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformTemplateSpecializationType(clang::TypeLocBuilder&, clang::TemplateSpecializationTypeLoc, clang::TemplateName) SemaTemplateInstantiate.cpp:0:0
#42 0x00005bb7fb43fab0 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformTemplateSpecializationType(clang::TypeLocBuilder&, clang::TemplateSpecializationTypeLoc) SemaTemplateInstantiate.cpp:0:0
#43 0x00005bb7fb3d817a clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformType(clang::TypeLocBuilder&, clang::TypeLoc) SemaTemplateInstantiate.cpp:0:0
#44 0x00005bb7fb43c1e5 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformElaboratedType(clang::TypeLocBuilder&, clang::ElaboratedTypeLoc) SemaTemplateInstantiate.cpp:0:0
#45 0x00005bb7fb3d8243 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformType(clang::TypeLocBuilder&, clang::TypeLoc) SemaTemplateInstantiate.cpp:0:0
#46 0x00005bb7fb3d7c46 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformType(clang::TypeSourceInfo*) SemaTemplateInstantiate.cpp:0:0
#47 0x00005bb7fb3d7894 clang::Sema::SubstType(clang::TypeSourceInfo*, clang::MultiLevelTemplateArgumentList const&, clang::SourceLocation, clang::DeclarationName, bool) (/home/mb/projects/llvm-project/build/bin/clang-20+0x654b894)
#48 0x00005bb7fb45d671 clang::TemplateDeclInstantiator::InstantiateTypedefNameDecl(clang::TypedefNameDecl*, bool) (/home/mb/projects/llvm-project/build/bin/clang-20+0x65d1671)
#49 0x00005bb7fb45eb7e clang::TemplateDeclInstantiator::VisitTypeAliasDecl(clang::TypeAliasDecl*) (/home/mb/projects/llvm-project/build/bin/clang-20+0x65d2b7e)
#50 0x00005bb7fb3dc9bc clang::Sema::InstantiateClass(clang::SourceLocation, clang::CXXRecordDecl*, clang::CXXRecordDecl*, clang::MultiLevelTemplateArgumentList const&, clang::TemplateSpecializationKind, bool) (/home/mb/projects/llvm-project/build/bin/clang-20+0x65509bc)
#51 0x00005bb7fb3dee89 clang::Sema::InstantiateClassTemplateSpecialization(clang::SourceLocation, clang::ClassTemplateSpecializationDecl*, clang::TemplateSpecializationKind, bool) (/home/mb/projects/llvm-project/build/bin/clang-20+0x6552e89)
#52 0x00005bb7fb4dcc9e void llvm::function_ref<void ()>::callback_fn<clang::Sema::RequireCompleteTypeImpl(clang::SourceLocation, clang::QualType, clang::Sema::CompleteTypeKind, clang::Sema::TypeDiagnoser*)::$_0>(long) SemaType.cpp:0:0
#53 0x00005bb7f97632cf clang::StackExhaustionHandler::runWithSufficientStackSpace(clang::SourceLocation, llvm::function_ref<void ()>) (/home/mb/projects/llvm-project/build/bin/clang-20+0x48d72cf)
#54 0x00005bb7fb4c354c clang::Sema::RequireCompleteTypeImpl(clang::SourceLocation, clang::QualType, clang::Sema::CompleteTypeKind, clang::Sema::TypeDiagnoser*) (/home/mb/projects/llvm-project/build/bin/clang-20+0x663754c)
#55 0x00005bb7fb4c2ec0 clang::Sema::RequireCompleteType(clang::SourceLocation, clang::QualType, clang::Sema::CompleteTypeKind, clang::Sema::TypeDiagnoser&) (/home/mb/projects/llvm-project/build/bin/clang-20+0x6636ec0)
#56 0x00005bb7fafcccbf clang::Sema::BuildCXXTypeConstructExpr(clang::TypeSourceInfo*, clang::SourceLocation, llvm::MutableArrayRef<clang::Expr*>, clang::SourceLocation, bool) (/home/mb/projects/llvm-project/build/bin/clang-20+0x6140cbf)
#57 0x00005bb7fb427203 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformCXXUnresolvedConstructExpr(clang::CXXUnresolvedConstructExpr*) SemaTemplateInstantiate.cpp:0:0
#58 0x00005bb7fb3dfd18 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformStmt(clang::Stmt*, clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::StmtDiscardKind) SemaTemplateInstantiate.cpp:0:0
#59 0x00005bb7fb42d7a8 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformCompoundStmt(clang::CompoundStmt*, bool) SemaTemplateInstantiate.cpp:0:0
#60 0x00005bb7fb3dfcaa clang::Sema::SubstStmt(clang::Stmt*, clang::MultiLevelTemplateArgumentList const&) (/home/mb/projects/llvm-project/build/bin/clang-20+0x6553caa)
#61 0x00005bb7fb4715e8 clang::Sema::InstantiateFunctionDefinition(clang::SourceLocation, clang::FunctionDecl*, bool, bool, bool) (/home/mb/projects/llvm-project/build/bin/clang-20+0x65e55e8)
#62 0x00005bb7fb47473f clang::Sema::PerformPendingInstantiations(bool) (/home/mb/projects/llvm-project/build/bin/clang-20+0x65e873f)
#63 0x00005bb7fac2a149 clang::Sema::ActOnEndOfTranslationUnitFragment(clang::Sema::TUFragmentKind) (/home/mb/projects/llvm-project/build/bin/clang-20+0x5d9e149)
#64 0x00005bb7fac2a8eb clang::Sema::ActOnEndOfTranslationUnit() (/home/mb/projects/llvm-project/build/bin/clang-20+0x5d9e8eb)
#65 0x00005bb7faadb4fe clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) (/home/mb/projects/llvm-project/build/bin/clang-20+0x5c4f4fe)
#66 0x00005bb7faad783e clang::ParseAST(clang::Sema&, bool, bool) (/home/mb/projects/llvm-project/build/bin/clang-20+0x5c4b83e)
#67 0x00005bb7f99ed1cf clang::FrontendAction::Execute() (/home/mb/projects/llvm-project/build/bin/clang-20+0x4b611cf)
#68 0x00005bb7f995df7d clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/home/mb/projects/llvm-project/build/bin/clang-20+0x4ad1f7d)
#69 0x00005bb7f9acd79a clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/home/mb/projects/llvm-project/build/bin/clang-20+0x4c4179a)
#70 0x00005bb7f7a178a1 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/home/mb/projects/llvm-project/build/bin/clang-20+0x2b8b8a1)
#71 0x00005bb7f7a13989 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) driver.cpp:0:0
#72 0x00005bb7f7a12a96 clang_main(int, char**, llvm::ToolContext const&) (/home/mb/projects/llvm-project/build/bin/clang-20+0x2b86a96)
#73 0x00005bb7f7a22a47 main (/home/mb/projects/llvm-project/build/bin/clang-20+0x2b96a47)
#74 0x00007b60b242a1ca __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:74:3
#75 0x00007b60b242a28b call_init ./csu/../csu/libc-start.c:128:20
#76 0x00007b60b242a28b __libc_start_main ./csu/../csu/libc-start.c:347:5
#77 0x00005bb7f7a11565 _start (/home/mb/projects/llvm-project/build/bin/clang-20+0x2b85565)
clang++: error: unable to execute command: Aborted (core dumped)
clang++: error: clang frontend command failed due to signal (use -v to see invocation)
clang version 20.0.0git (https://github.com/llvm/llvm-project.git 17c8c1c5098bd1fa68809d686867d01d56d5e564)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/mb/projects/llvm-project/build/bin
Build config: +assertions
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/file2-258139.cppm
clang++: note: diagnostic msg: /tmp/file2-258139.sh
clang++: note: diagnostic msg: 

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

There is another issue with exactly same assertion message: #15198. But I don't think this one is duplicate: as far as I can see, this code makes no attempt to declare additional overload for the lambda call operator, in particular no friend-s are involved.

@EugeneZelenko EugeneZelenko added clang:modules C++20 modules and Clang Header Modules crash Prefer [crash-on-valid] or [crash-on-invalid] and removed new issue labels Jan 9, 2025
@llvmbot
Copy link
Member

llvmbot commented Jan 9, 2025

@llvm/issue-subscribers-clang-modules

Author: Mikail Bagishov (MikailBag)

Code (https://gist.github.com/MikailBag/75ff72a9e3cd7e4ef9dbdeb5523c4ca9) I can't provide a single preprocessed source file, since code uses modules.

This code is likely invalid (each file contains independently reduced copy of std and stdexec so some ODR violations were bound to occur; in particular __make_sexpr_t struct has different definitions in TUs; Xclang -fno-skip-odr-check-in-gmf gives errors as well).

I get the following error

clang-20: /home/mb/projects/llvm-project/clang/lib/AST/DeclCXX.cpp:1650: NamedDecl *getLambdaCallOperatorHelper(const CXXRecordDecl &amp;): Assertion `allLookupResultsAreTheSame(Calls) &amp;&amp; "More than one lambda call operator!"' 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: /home/mb/projects/llvm-project/build/bin/clang-20 -cc1 -triple x86_64-unknown-linux-gnu -emit-module-interface -disable-free -clear-ast-before-backend -main-file-name file2.cpp -mrelocation-model pic -pic-level 2 -pic-is-pie -mframe-pointer=all -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fdebug-compilation-dir=/home/mb/projects/temp -fcoverage-compilation-dir=/home/mb/projects/temp -resource-dir /home/mb/projects/llvm-project/build/lib/clang/20 -internal-isystem /home/mb/projects/llvm-project/build/bin/../include/x86_64-unknown-linux-gnu/c++/v1 -internal-isystem /home/mb/projects/llvm-project/build/bin/../include/c++/v1 -internal-isystem /home/mb/projects/llvm-project/build/lib/clang/20/include -internal-isystem /usr/local/include -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/14/../../../../x86_64-linux-gnu/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -Wall -Wextra -Wpedantic -std=c++23 -fdeprecated-macro -ferror-limit 19 -fgnuc-version=4.2.1 -fno-implicit-modules -fmodule-file=util=util.pcm -fskip-odr-check-in-gmf -fcxx-exceptions -fexceptions -fcolor-diagnostics -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o out.pcm -x c++ /home/mb/projects/temp/file2.cpp
1.	&lt;eof&gt; parser at end of file
2.	/home/mb/projects/temp/file2.cpp:28:8: instantiating function definition 'stdexec::__make_sexpr_t&lt;stdexec::just_t&gt;::operator()&lt;int&gt;'
3.	/home/mb/projects/temp/file2.cpp:19:40: instantiating class definition 'stdexec::__sexpr&lt;(lambda at /home/mb/projects/temp/file2.cpp:24:28){}&gt;'
4.	/home/mb/projects/temp/file2.cpp:12:28: instantiating function definition 'stdexec::__detail::(anonymous class)::operator()&lt;stdexec::__detail::(lambda at /home/mb/projects/temp/file2.cpp:11:20) (*)()&gt;'
 #<!-- -->0 0x00005bb7f8d1e918 llvm::sys::PrintStackTrace(llvm::raw_ostream&amp;, int) (/home/mb/projects/llvm-project/build/bin/clang-20+0x3e92918)
 #<!-- -->1 0x00005bb7f8d1c3ce llvm::sys::RunSignalHandlers() (/home/mb/projects/llvm-project/build/bin/clang-20+0x3e903ce)
 #<!-- -->2 0x00005bb7f8d1f108 SignalHandler(int) Signals.cpp:0:0
 #<!-- -->3 0x00007b60b2445320 (/lib/x86_64-linux-gnu/libc.so.6+0x45320)
 #<!-- -->4 0x00007b60b249eb1c __pthread_kill_implementation ./nptl/pthread_kill.c:44:76
 #<!-- -->5 0x00007b60b249eb1c __pthread_kill_internal ./nptl/pthread_kill.c:78:10
 #<!-- -->6 0x00007b60b249eb1c pthread_kill ./nptl/pthread_kill.c:89:10
 #<!-- -->7 0x00007b60b244526e raise ./signal/../sysdeps/posix/raise.c:27:6
 #<!-- -->8 0x00007b60b24288ff abort ./stdlib/abort.c:81:7
 #<!-- -->9 0x00007b60b242881b _nl_load_domain ./intl/loadmsgcat.c:1177:9
#<!-- -->10 0x00007b60b243b507 (/lib/x86_64-linux-gnu/libc.so.6+0x3b507)
#<!-- -->11 0x00005bb7fb88ac27 getLambdaCallOperatorHelper(clang::CXXRecordDecl const&amp;) DeclCXX.cpp:0:0
#<!-- -->12 0x00005bb7fb88ac56 clang::CXXRecordDecl::getLambdaCallOperator() const (/home/mb/projects/llvm-project/build/bin/clang-20+0x69fec56)
#<!-- -->13 0x00005bb7fb9f001f clang::LambdaExpr::isMutable() const (/home/mb/projects/llvm-project/build/bin/clang-20+0x6b6401f)
#<!-- -->14 0x00005bb7fb433a90 clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::TransformLambdaExpr(clang::LambdaExpr*) SemaTemplateInstantiate.cpp:0:0
#<!-- -->15 0x00005bb7fb4236d3 (anonymous namespace)::TemplateInstantiator::TransformLambdaExpr(clang::LambdaExpr*) SemaTemplateInstantiate.cpp:0:0
#<!-- -->16 0x00005bb7fb3dfd18 clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::TransformStmt(clang::Stmt*, clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::StmtDiscardKind) SemaTemplateInstantiate.cpp:0:0
#<!-- -->17 0x00005bb7fb42d7a8 clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::TransformCompoundStmt(clang::CompoundStmt*, bool) SemaTemplateInstantiate.cpp:0:0
#<!-- -->18 0x00005bb7fb3dfcaa clang::Sema::SubstStmt(clang::Stmt*, clang::MultiLevelTemplateArgumentList const&amp;) (/home/mb/projects/llvm-project/build/bin/clang-20+0x6553caa)
#<!-- -->19 0x00005bb7fb4715e8 clang::Sema::InstantiateFunctionDefinition(clang::SourceLocation, clang::FunctionDecl*, bool, bool, bool) (/home/mb/projects/llvm-project/build/bin/clang-20+0x65e55e8)
#<!-- -->20 0x00005bb7f97632cf clang::StackExhaustionHandler::runWithSufficientStackSpace(clang::SourceLocation, llvm::function_ref&lt;void ()&gt;) (/home/mb/projects/llvm-project/build/bin/clang-20+0x48d72cf)
#<!-- -->21 0x00005bb7fb34857c clang::Sema::DeduceReturnType(clang::FunctionDecl*, clang::SourceLocation, bool) (/home/mb/projects/llvm-project/build/bin/clang-20+0x64bc57c)
#<!-- -->22 0x00005bb7faec606e clang::Sema::DiagnoseUseOfDecl(clang::NamedDecl*, llvm::ArrayRef&lt;clang::SourceLocation&gt;, clang::ObjCInterfaceDecl const*, bool, bool, clang::ObjCInterfaceDecl*, bool) (/home/mb/projects/llvm-project/build/bin/clang-20+0x603a06e)
#<!-- -->23 0x00005bb7fb24a1e3 CreateFunctionRefExpr(clang::Sema&amp;, clang::FunctionDecl*, clang::NamedDecl*, clang::Expr const*, bool, clang::SourceLocation, clang::DeclarationNameLoc const&amp;) SemaOverload.cpp:0:0
#<!-- -->24 0x00005bb7fb2532ac clang::Sema::BuildCallToObjectOfClassType(clang::Scope*, clang::Expr*, clang::SourceLocation, llvm::MutableArrayRef&lt;clang::Expr*&gt;, clang::SourceLocation) (/home/mb/projects/llvm-project/build/bin/clang-20+0x63c72ac)
#<!-- -->25 0x00005bb7faecc631 clang::Sema::BuildCallExpr(clang::Scope*, clang::Expr*, clang::SourceLocation, llvm::MutableArrayRef&lt;clang::Expr*&gt;, clang::SourceLocation, clang::Expr*, bool, bool) (/home/mb/projects/llvm-project/build/bin/clang-20+0x6040631)
#<!-- -->26 0x00005bb7faee35bb clang::Sema::ActOnCallExpr(clang::Scope*, clang::Expr*, clang::SourceLocation, llvm::MutableArrayRef&lt;clang::Expr*&gt;, clang::SourceLocation, clang::Expr*) (/home/mb/projects/llvm-project/build/bin/clang-20+0x60575bb)
#<!-- -->27 0x00005bb7fb42658f clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::TransformCallExpr(clang::CallExpr*) SemaTemplateInstantiate.cpp:0:0
#<!-- -->28 0x00005bb7fb43a1db clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::TransformDecltypeType(clang::TypeLocBuilder&amp;, clang::DecltypeTypeLoc) SemaTemplateInstantiate.cpp:0:0
#<!-- -->29 0x00005bb7fb3d85e2 clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::TransformType(clang::TypeLocBuilder&amp;, clang::TypeLoc) SemaTemplateInstantiate.cpp:0:0
#<!-- -->30 0x00005bb7fb3d7c46 clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::TransformType(clang::TypeSourceInfo*) SemaTemplateInstantiate.cpp:0:0
#<!-- -->31 0x00005bb7fb3d8812 clang::Sema::SubstType(clang::QualType, clang::MultiLevelTemplateArgumentList const&amp;, clang::SourceLocation, clang::DeclarationName, bool*) (/home/mb/projects/llvm-project/build/bin/clang-20+0x654c812)
#<!-- -->32 0x00005bb7fb2afe73 clang::Sema::CheckTemplateIdType(clang::TemplateName, clang::SourceLocation, clang::TemplateArgumentListInfo&amp;) (/home/mb/projects/llvm-project/build/bin/clang-20+0x6423e73)
#<!-- -->33 0x00005bb7fb436a5d clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::TransformTemplateSpecializationType(clang::TypeLocBuilder&amp;, clang::TemplateSpecializationTypeLoc, clang::TemplateName) SemaTemplateInstantiate.cpp:0:0
#<!-- -->34 0x00005bb7fb43fab0 clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::TransformTemplateSpecializationType(clang::TypeLocBuilder&amp;, clang::TemplateSpecializationTypeLoc) SemaTemplateInstantiate.cpp:0:0
#<!-- -->35 0x00005bb7fb3d817a clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::TransformType(clang::TypeLocBuilder&amp;, clang::TypeLoc) SemaTemplateInstantiate.cpp:0:0
#<!-- -->36 0x00005bb7fb43c1e5 clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::TransformElaboratedType(clang::TypeLocBuilder&amp;, clang::ElaboratedTypeLoc) SemaTemplateInstantiate.cpp:0:0
#<!-- -->37 0x00005bb7fb3d8243 clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::TransformType(clang::TypeLocBuilder&amp;, clang::TypeLoc) SemaTemplateInstantiate.cpp:0:0
#<!-- -->38 0x00005bb7fb3d7c46 clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::TransformType(clang::TypeSourceInfo*) SemaTemplateInstantiate.cpp:0:0
#<!-- -->39 0x00005bb7fb3d8812 clang::Sema::SubstType(clang::QualType, clang::MultiLevelTemplateArgumentList const&amp;, clang::SourceLocation, clang::DeclarationName, bool*) (/home/mb/projects/llvm-project/build/bin/clang-20+0x654c812)
#<!-- -->40 0x00005bb7fb2afe73 clang::Sema::CheckTemplateIdType(clang::TemplateName, clang::SourceLocation, clang::TemplateArgumentListInfo&amp;) (/home/mb/projects/llvm-project/build/bin/clang-20+0x6423e73)
#<!-- -->41 0x00005bb7fb436a5d clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::TransformTemplateSpecializationType(clang::TypeLocBuilder&amp;, clang::TemplateSpecializationTypeLoc, clang::TemplateName) SemaTemplateInstantiate.cpp:0:0
#<!-- -->42 0x00005bb7fb43fab0 clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::TransformTemplateSpecializationType(clang::TypeLocBuilder&amp;, clang::TemplateSpecializationTypeLoc) SemaTemplateInstantiate.cpp:0:0
#<!-- -->43 0x00005bb7fb3d817a clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::TransformType(clang::TypeLocBuilder&amp;, clang::TypeLoc) SemaTemplateInstantiate.cpp:0:0
#<!-- -->44 0x00005bb7fb43c1e5 clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::TransformElaboratedType(clang::TypeLocBuilder&amp;, clang::ElaboratedTypeLoc) SemaTemplateInstantiate.cpp:0:0
#<!-- -->45 0x00005bb7fb3d8243 clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::TransformType(clang::TypeLocBuilder&amp;, clang::TypeLoc) SemaTemplateInstantiate.cpp:0:0
#<!-- -->46 0x00005bb7fb3d7c46 clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::TransformType(clang::TypeSourceInfo*) SemaTemplateInstantiate.cpp:0:0
#<!-- -->47 0x00005bb7fb3d7894 clang::Sema::SubstType(clang::TypeSourceInfo*, clang::MultiLevelTemplateArgumentList const&amp;, clang::SourceLocation, clang::DeclarationName, bool) (/home/mb/projects/llvm-project/build/bin/clang-20+0x654b894)
#<!-- -->48 0x00005bb7fb45d671 clang::TemplateDeclInstantiator::InstantiateTypedefNameDecl(clang::TypedefNameDecl*, bool) (/home/mb/projects/llvm-project/build/bin/clang-20+0x65d1671)
#<!-- -->49 0x00005bb7fb45eb7e clang::TemplateDeclInstantiator::VisitTypeAliasDecl(clang::TypeAliasDecl*) (/home/mb/projects/llvm-project/build/bin/clang-20+0x65d2b7e)
#<!-- -->50 0x00005bb7fb3dc9bc clang::Sema::InstantiateClass(clang::SourceLocation, clang::CXXRecordDecl*, clang::CXXRecordDecl*, clang::MultiLevelTemplateArgumentList const&amp;, clang::TemplateSpecializationKind, bool) (/home/mb/projects/llvm-project/build/bin/clang-20+0x65509bc)
#<!-- -->51 0x00005bb7fb3dee89 clang::Sema::InstantiateClassTemplateSpecialization(clang::SourceLocation, clang::ClassTemplateSpecializationDecl*, clang::TemplateSpecializationKind, bool) (/home/mb/projects/llvm-project/build/bin/clang-20+0x6552e89)
#<!-- -->52 0x00005bb7fb4dcc9e void llvm::function_ref&lt;void ()&gt;::callback_fn&lt;clang::Sema::RequireCompleteTypeImpl(clang::SourceLocation, clang::QualType, clang::Sema::CompleteTypeKind, clang::Sema::TypeDiagnoser*)::$_0&gt;(long) SemaType.cpp:0:0
#<!-- -->53 0x00005bb7f97632cf clang::StackExhaustionHandler::runWithSufficientStackSpace(clang::SourceLocation, llvm::function_ref&lt;void ()&gt;) (/home/mb/projects/llvm-project/build/bin/clang-20+0x48d72cf)
#<!-- -->54 0x00005bb7fb4c354c clang::Sema::RequireCompleteTypeImpl(clang::SourceLocation, clang::QualType, clang::Sema::CompleteTypeKind, clang::Sema::TypeDiagnoser*) (/home/mb/projects/llvm-project/build/bin/clang-20+0x663754c)
#<!-- -->55 0x00005bb7fb4c2ec0 clang::Sema::RequireCompleteType(clang::SourceLocation, clang::QualType, clang::Sema::CompleteTypeKind, clang::Sema::TypeDiagnoser&amp;) (/home/mb/projects/llvm-project/build/bin/clang-20+0x6636ec0)
#<!-- -->56 0x00005bb7fafcccbf clang::Sema::BuildCXXTypeConstructExpr(clang::TypeSourceInfo*, clang::SourceLocation, llvm::MutableArrayRef&lt;clang::Expr*&gt;, clang::SourceLocation, bool) (/home/mb/projects/llvm-project/build/bin/clang-20+0x6140cbf)
#<!-- -->57 0x00005bb7fb427203 clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::TransformCXXUnresolvedConstructExpr(clang::CXXUnresolvedConstructExpr*) SemaTemplateInstantiate.cpp:0:0
#<!-- -->58 0x00005bb7fb3dfd18 clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::TransformStmt(clang::Stmt*, clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::StmtDiscardKind) SemaTemplateInstantiate.cpp:0:0
#<!-- -->59 0x00005bb7fb42d7a8 clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::TransformCompoundStmt(clang::CompoundStmt*, bool) SemaTemplateInstantiate.cpp:0:0
#<!-- -->60 0x00005bb7fb3dfcaa clang::Sema::SubstStmt(clang::Stmt*, clang::MultiLevelTemplateArgumentList const&amp;) (/home/mb/projects/llvm-project/build/bin/clang-20+0x6553caa)
#<!-- -->61 0x00005bb7fb4715e8 clang::Sema::InstantiateFunctionDefinition(clang::SourceLocation, clang::FunctionDecl*, bool, bool, bool) (/home/mb/projects/llvm-project/build/bin/clang-20+0x65e55e8)
#<!-- -->62 0x00005bb7fb47473f clang::Sema::PerformPendingInstantiations(bool) (/home/mb/projects/llvm-project/build/bin/clang-20+0x65e873f)
#<!-- -->63 0x00005bb7fac2a149 clang::Sema::ActOnEndOfTranslationUnitFragment(clang::Sema::TUFragmentKind) (/home/mb/projects/llvm-project/build/bin/clang-20+0x5d9e149)
#<!-- -->64 0x00005bb7fac2a8eb clang::Sema::ActOnEndOfTranslationUnit() (/home/mb/projects/llvm-project/build/bin/clang-20+0x5d9e8eb)
#<!-- -->65 0x00005bb7faadb4fe clang::Parser::ParseTopLevelDecl(clang::OpaquePtr&lt;clang::DeclGroupRef&gt;&amp;, clang::Sema::ModuleImportState&amp;) (/home/mb/projects/llvm-project/build/bin/clang-20+0x5c4f4fe)
#<!-- -->66 0x00005bb7faad783e clang::ParseAST(clang::Sema&amp;, bool, bool) (/home/mb/projects/llvm-project/build/bin/clang-20+0x5c4b83e)
#<!-- -->67 0x00005bb7f99ed1cf clang::FrontendAction::Execute() (/home/mb/projects/llvm-project/build/bin/clang-20+0x4b611cf)
#<!-- -->68 0x00005bb7f995df7d clang::CompilerInstance::ExecuteAction(clang::FrontendAction&amp;) (/home/mb/projects/llvm-project/build/bin/clang-20+0x4ad1f7d)
#<!-- -->69 0x00005bb7f9acd79a clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/home/mb/projects/llvm-project/build/bin/clang-20+0x4c4179a)
#<!-- -->70 0x00005bb7f7a178a1 cc1_main(llvm::ArrayRef&lt;char const*&gt;, char const*, void*) (/home/mb/projects/llvm-project/build/bin/clang-20+0x2b8b8a1)
#<!-- -->71 0x00005bb7f7a13989 ExecuteCC1Tool(llvm::SmallVectorImpl&lt;char const*&gt;&amp;, llvm::ToolContext const&amp;) driver.cpp:0:0
#<!-- -->72 0x00005bb7f7a12a96 clang_main(int, char**, llvm::ToolContext const&amp;) (/home/mb/projects/llvm-project/build/bin/clang-20+0x2b86a96)
#<!-- -->73 0x00005bb7f7a22a47 main (/home/mb/projects/llvm-project/build/bin/clang-20+0x2b96a47)
#<!-- -->74 0x00007b60b242a1ca __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:74:3
#<!-- -->75 0x00007b60b242a28b call_init ./csu/../csu/libc-start.c:128:20
#<!-- -->76 0x00007b60b242a28b __libc_start_main ./csu/../csu/libc-start.c:347:5
#<!-- -->77 0x00005bb7f7a11565 _start (/home/mb/projects/llvm-project/build/bin/clang-20+0x2b85565)
clang++: error: unable to execute command: Aborted (core dumped)
clang++: error: clang frontend command failed due to signal (use -v to see invocation)
clang version 20.0.0git (https://github.com/llvm/llvm-project.git 17c8c1c5098bd1fa68809d686867d01d56d5e564)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/mb/projects/llvm-project/build/bin
Build config: +assertions
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/file2-258139.cppm
clang++: note: diagnostic msg: /tmp/file2-258139.sh
clang++: note: diagnostic msg: 

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

There is another issue with exactly same assertion message: #15198. But I don't think this one is duplicate: as far as I can see, this code makes no attempt to declare additional overload for the lambda call operator, in particular no friend-s are involved.

@ChuanqiXu9 ChuanqiXu9 self-assigned this Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:modules C++20 modules and Clang Header Modules crash Prefer [crash-on-valid] or [crash-on-invalid]
Projects
None yet
Development

No branches or pull requests

4 participants