Skip to content

[Clang] [Modules] Clang instantiates the wrong lambda call operator #110401

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

Closed
Sirraide opened this issue Sep 29, 2024 · 13 comments · Fixed by #110446
Closed

[Clang] [Modules] Clang instantiates the wrong lambda call operator #110401

Sirraide opened this issue Sep 29, 2024 · 13 comments · Fixed by #110446
Assignees
Labels
clang:frontend Language frontend issues, e.g. anything involving "Sema" clang:modules C++20 modules and Clang Header Modules lambda C++11 lambda expressions

Comments

@Sirraide
Copy link
Member

Sirraide commented Sep 29, 2024

Update: See #110401 (comment) for a reduced version + cc1 invocations.

Given a.ccm:

module; 
#include <variant>
#include <string>
export module A;

export using Foo = std::variant<int, std::string, std::monostate>;
struct S {
    Foo x = std::monostate{};
};

and b.ccm:

module;
#include <variant>
export module B;
import A;

void f() {
    Foo x;
    auto y = x;
}

Attempting to compile this asserts on trunk (https://godbolt.org/z/sqWax9eKq). I have not been able to reproduce this w/o modules (yet, but I’ll keep trying). #102353 seems to be the same assertion, but I’m not sure they’re related.

/root/llvm-project/clang/lib/Sema/SemaTemplateInstantiate.cpp:4439: 
llvm::PointerUnion<clang::Decl*, llvm::SmallVector<clang::VarDecl*, 4>*>* 
clang::LocalInstantiationScope::findInstantiationOf(const clang::Decl*): 
Assertion `isa<LabelDecl>(D) && "declaration not instantiated in this scope"' failed.

Invocation:

/opt/compiler-explorer/clang-assertions-trunk/bin/clang++ --gcc-toolchain=/opt/compiler-explorer/gcc-snapshot   -fcolor-diagnostics -fno-crash-diagnostics -isystem/opt/compiler-explorer/libs/fmt/7.1.3/include -O2 -g -DNDEBUG -std=gnu++26 -MD -MT CMakeFiles/bug.dir/b.ccm.o -MF CMakeFiles/bug.dir/b.ccm.o.d @CMakeFiles/bug.dir/b.ccm.o.modmap -o CMakeFiles/bug.dir/b.ccm.o -c /app/b.ccm

It’s clearly crashing in b.ccm, but that might be due to a faulty module being emitted for a.ccm. I’m unfortunately not that familiar w/ our modules implementation, so I don’t know which one is more likely.

Stack trace:

Stack dump:
0.	Program arguments: /opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20 -cc1 -triple x86_64-unknown-linux-gnu -emit-module-interface -disable-free -clear-ast-before-backend -main-file-name b.ccm -mrelocation-model pic -pic-level 2 -pic-is-pie -mframe-pointer=none -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debug-info-kind=constructor -dwarf-version=5 -debugger-tuning=gdb -fdebug-compilation-dir=/app/build -fcoverage-compilation-dir=/app/build -resource-dir /opt/compiler-explorer/clang-assertions-trunk-20240928/lib/clang/20 -dependency-file CMakeFiles/bug.dir/b.ccm.o.d -MT CMakeFiles/bug.dir/b.ccm.o -sys-header-deps -module-file-deps -isystem /opt/compiler-explorer/libs/fmt/7.1.3/include -D NDEBUG -internal-isystem /opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/15.0.0/../../../../include/c++/15.0.0 -internal-isystem /opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/15.0.0/../../../../include/c++/15.0.0/x86_64-linux-gnu -internal-isystem /opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/15.0.0/../../../../include/c++/15.0.0/backward -internal-isystem /opt/compiler-explorer/clang-assertions-trunk-20240928/lib/clang/20/include -internal-isystem /usr/local/include -internal-isystem /opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/15.0.0/../../../../x86_64-linux-gnu/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -O2 -std=gnu++26 -fdeprecated-macro -ferror-limit 19 -fgnuc-version=4.2.1 -fno-implicit-modules -fmodule-file=A=CMakeFiles/bug.dir/A.pcm -fskip-odr-check-in-gmf -fcxx-exceptions -fexceptions -fcolor-diagnostics -vectorize-loops -vectorize-slp -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o CMakeFiles/bug.dir/B.pcm -x c++ /app/b.ccm
1.	/app/b.ccm:8:15: current parser token ';'
2.	/app/b.ccm:6:10: parsing function body 'f'
3.	/app/b.ccm:6:10: in compound statement ('{}')
4.	/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/15.0.0/../../../../include/c++/15.0.0/variant:582:7: instantiating function definition 'std::__detail::__variant::_Copy_ctor_base<false, int, std::basic_string<char>, std::monostate>::_Copy_ctor_base'
5.	/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/15.0.0/../../../../include/c++/15.0.0/variant:185:5: instantiating function definition 'std::__detail::__variant::__raw_idx_visit<(lambda at /opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/15.0.0/../../../../include/c++/15.0.0/variant:586:4), const std::variant<int, std::basic_string<char>, std::monostate> &>'
6.	/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/15.0.0/../../../../include/c++/15.0.0/variant:1844:5: instantiating function definition 'std::__do_visit<std::__detail::__variant::__variant_idx_cookie, (lambda at /opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/15.0.0/../../../../include/c++/15.0.0/variant:586:4), const std::variant<int, std::basic_string<char>, std::monostate> &>'
  #0 0x0000000003b8cab8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x3b8cab8)
  #1 0x0000000003b8a46c SignalHandler(int) Signals.cpp:0:0
  #2 0x00007530a7a42520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
  #3 0x00007530a7a969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
  #4 0x00007530a7a42476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
  #5 0x00007530a7a287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
  #6 0x00007530a7a2871b (/lib/x86_64-linux-gnu/libc.so.6+0x2871b)
  #7 0x00007530a7a39e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
  #8 0x00000000072eac9e clang::LocalInstantiationScope::findInstantiationOf(clang::Decl const*) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x72eac9e)
  #9 0x00000000073a81a7 clang::Sema::FindInstantiatedDecl(clang::SourceLocation, clang::NamedDecl*, clang::MultiLevelTemplateArgumentList const&, bool) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x73a81a7)
 #10 0x00000000072d75c1 (anonymous namespace)::TemplateInstantiator::TransformDecl(clang::SourceLocation, clang::Decl*) SemaTemplateInstantiate.cpp:0:0
 #11 0x000000000730bf58 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformType(clang::TypeLocBuilder&, clang::TypeLoc) SemaTemplateInstantiate.cpp:0:0
 #12 0x000000000732c654 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformElaboratedType(clang::TypeLocBuilder&, clang::ElaboratedTypeLoc) SemaTemplateInstantiate.cpp:0:0
 #13 0x000000000730b643 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformType(clang::TypeLocBuilder&, clang::TypeLoc) SemaTemplateInstantiate.cpp:0:0
 #14 0x00000000073116bd clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformReferenceType(clang::TypeLocBuilder&, clang::ReferenceTypeLoc) SemaTemplateInstantiate.cpp:0:0
 #15 0x000000000730bbfc clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformType(clang::TypeLocBuilder&, clang::TypeLoc) SemaTemplateInstantiate.cpp:0:0
 #16 0x0000000007311e0a clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformType(clang::TypeSourceInfo*) SemaTemplateInstantiate.cpp:0:0
 #17 0x00000000073207f6 clang::Sema::SubstType(clang::TypeSourceInfo*, clang::MultiLevelTemplateArgumentList const&, clang::SourceLocation, clang::DeclarationName, bool) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x73207f6)
 #18 0x000000000732f345 clang::Sema::SubstParmVarDecl(clang::ParmVarDecl*, clang::MultiLevelTemplateArgumentList const&, int, std::optional<unsigned int>, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x732f345)
 #19 0x00000000073309e0 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformFunctionTypeParams(clang::SourceLocation, llvm::ArrayRef<clang::ParmVarDecl*>, clang::QualType const*, clang::FunctionType::ExtParameterInfo const*, llvm::SmallVectorImpl<clang::QualType>&, llvm::SmallVectorImpl<clang::ParmVarDecl*>*, clang::Sema::ExtParameterInfoBuilder&, unsigned int*) SemaTemplateInstantiate.cpp:0:0
 #20 0x000000000730a22f clang::QualType clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformFunctionProtoType<clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformFunctionProtoType(clang::TypeLocBuilder&, clang::FunctionProtoTypeLoc)::'lambda'(clang::FunctionProtoType::ExceptionSpecInfo&, bool&)>(clang::TypeLocBuilder&, clang::FunctionProtoTypeLoc, clang::CXXRecordDecl*, clang::Qualifiers, clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformFunctionProtoType(clang::TypeLocBuilder&, clang::FunctionProtoTypeLoc)::'lambda'(clang::FunctionProtoType::ExceptionSpecInfo&, bool&)) (.constprop.0) SemaTemplateInstantiate.cpp:0:0
 #21 0x000000000730b7b4 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformType(clang::TypeLocBuilder&, clang::TypeLoc) SemaTemplateInstantiate.cpp:0:0
 #22 0x00000000072f8a51 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformLambdaExpr(clang::LambdaExpr*) SemaTemplateInstantiate.cpp:0:0
 #23 0x00000000072fa7cd clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformExpr(clang::Expr*) SemaTemplateInstantiate.cpp:0:0
 #24 0x00000000073069ee clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformCallExpr(clang::CallExpr*) SemaTemplateInstantiate.cpp:0:0
 #25 0x00000000072fa327 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformExpr(clang::Expr*) SemaTemplateInstantiate.cpp:0:0
 #26 0x00000000072fc058 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformInitializer(clang::Expr*, bool) (.part.0) SemaTemplateInstantiate.cpp:0:0
 #27 0x00000000072fc67b clang::Sema::SubstInitializer(clang::Expr*, clang::MultiLevelTemplateArgumentList const&, bool) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x72fc67b)
 #28 0x00000000073647d6 clang::Sema::InstantiateVariableInitializer(clang::VarDecl*, clang::VarDecl*, clang::MultiLevelTemplateArgumentList const&) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x73647d6)
 #29 0x00000000073ab910 clang::Sema::BuildVariableInstantiation(clang::VarDecl*, clang::VarDecl*, clang::MultiLevelTemplateArgumentList const&, llvm::SmallVector<clang::Sema::LateInstantiatedAttribute, 16u>*, clang::DeclContext*, clang::LocalInstantiationScope*, bool, clang::VarTemplateSpecializationDecl*) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x73ab910)
 #30 0x00000000073b5e17 clang::TemplateDeclInstantiator::VisitVarDecl(clang::VarDecl*, bool, llvm::ArrayRef<clang::BindingDecl*>*) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x73b5e17)
 #31 0x00000000073baf44 void llvm::function_ref<void ()>::callback_fn<clang::Sema::SubstDecl(clang::Decl*, clang::DeclContext*, clang::MultiLevelTemplateArgumentList const&)::'lambda'()>(long) SemaTemplateInstantiateDecl.cpp:0:0
 #32 0x000000000677ac21 clang::Sema::runWithSufficientStackSpace(clang::SourceLocation, llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x677ac21)
 #33 0x00000000073626ba clang::Sema::SubstDecl(clang::Decl*, clang::DeclContext*, clang::MultiLevelTemplateArgumentList const&) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x73626ba)
 #34 0x00000000072eba15 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformDeclStmt(clang::DeclStmt*) SemaTemplateInstantiate.cpp:0:0
 #35 0x0000000007339ec4 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformCompoundStmt(clang::CompoundStmt*, bool) SemaTemplateInstantiate.cpp:0:0
 #36 0x000000000733fe97 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformIfStmt(clang::IfStmt*) SemaTemplateInstantiate.cpp:0:0
 #37 0x0000000007339ec4 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformCompoundStmt(clang::CompoundStmt*, bool) SemaTemplateInstantiate.cpp:0:0
 #38 0x000000000733fe97 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformIfStmt(clang::IfStmt*) SemaTemplateInstantiate.cpp:0:0
 #39 0x0000000007339ec4 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformCompoundStmt(clang::CompoundStmt*, bool) SemaTemplateInstantiate.cpp:0:0
 #40 0x0000000007341964 clang::Sema::SubstStmt(clang::Stmt*, clang::MultiLevelTemplateArgumentList const&) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x7341964)
 #41 0x00000000073af5d9 clang::Sema::InstantiateFunctionDefinition(clang::SourceLocation, clang::FunctionDecl*, bool, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x73af5d9)
 #42 0x000000000677ac21 clang::Sema::runWithSufficientStackSpace(clang::SourceLocation, llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x677ac21)
 #43 0x00000000071e24e2 clang::Sema::DeduceReturnType(clang::FunctionDecl*, clang::SourceLocation, bool) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x71e24e2)
 #44 0x0000000006b9e4a5 clang::Sema::DiagnoseUseOfDecl(clang::NamedDecl*, llvm::ArrayRef<clang::SourceLocation>, clang::ObjCInterfaceDecl const*, bool, bool, clang::ObjCInterfaceDecl*, bool) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6b9e4a5)
 #45 0x0000000007061844 FinishOverloadedCallExpr(clang::Sema&, clang::Scope*, clang::Expr*, clang::UnresolvedLookupExpr*, clang::SourceLocation, llvm::MutableArrayRef<clang::Expr*>, clang::SourceLocation, clang::Expr*, clang::OverloadCandidateSet*, clang::OverloadCandidate**, clang::OverloadingResult, bool) SemaOverload.cpp:0:0
 #46 0x00000000070626f4 clang::Sema::BuildOverloadedCallExpr(clang::Scope*, clang::Expr*, clang::UnresolvedLookupExpr*, clang::SourceLocation, llvm::MutableArrayRef<clang::Expr*>, clang::SourceLocation, clang::Expr*, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x70626f4)
 #47 0x0000000006c159a8 clang::Sema::BuildCallExpr(clang::Scope*, clang::Expr*, clang::SourceLocation, llvm::MutableArrayRef<clang::Expr*>, clang::SourceLocation, clang::Expr*, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6c159a8)
 #48 0x0000000006c17f0c clang::Sema::ActOnCallExpr(clang::Scope*, clang::Expr*, clang::SourceLocation, llvm::MutableArrayRef<clang::Expr*>, clang::SourceLocation, clang::Expr*) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6c17f0c)
 #49 0x0000000007306ac1 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformCallExpr(clang::CallExpr*) SemaTemplateInstantiate.cpp:0:0
 #50 0x00000000072fa327 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformExpr(clang::Expr*) SemaTemplateInstantiate.cpp:0:0
 #51 0x00000000073396ff clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformStmt(clang::Stmt*, clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::StmtDiscardKind) SemaTemplateInstantiate.cpp:0:0
 #52 0x0000000007339ec4 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformCompoundStmt(clang::CompoundStmt*, bool) SemaTemplateInstantiate.cpp:0:0
 #53 0x0000000007341964 clang::Sema::SubstStmt(clang::Stmt*, clang::MultiLevelTemplateArgumentList const&) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x7341964)
 #54 0x00000000073af5d9 clang::Sema::InstantiateFunctionDefinition(clang::SourceLocation, clang::FunctionDecl*, bool, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x73af5d9)
 #55 0x0000000006bf3399 void llvm::function_ref<void ()>::callback_fn<clang::Sema::MarkFunctionReferenced(clang::SourceLocation, clang::FunctionDecl*, bool)::'lambda'()>(long) SemaExpr.cpp:0:0
 #56 0x000000000677ac21 clang::Sema::runWithSufficientStackSpace(clang::SourceLocation, llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x677ac21)
 #57 0x0000000006be793f clang::Sema::MarkFunctionReferenced(clang::SourceLocation, clang::FunctionDecl*, bool) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6be793f)
 #58 0x0000000006be7fcd MarkExprReferenced(clang::Sema&, clang::SourceLocation, clang::Decl*, clang::Expr*, bool, llvm::DenseMap<clang::VarDecl const*, int, llvm::DenseMapInfo<clang::VarDecl const*, void>, llvm::detail::DenseMapPair<clang::VarDecl const*, int>>&) SemaExpr.cpp:0:0
 #59 0x0000000006be8619 clang::Sema::BuildDeclRefExpr(clang::ValueDecl*, clang::QualType, clang::ExprValueKind, clang::DeclarationNameInfo const&, clang::NestedNameSpecifierLoc, clang::NamedDecl*, clang::SourceLocation, clang::TemplateArgumentListInfo const*) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6be8619)
 #60 0x000000000702e36b clang::Sema::FixOverloadedFunctionReference(clang::Expr*, clang::DeclAccessPair, clang::FunctionDecl*) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x702e36b)
 #61 0x000000000706158e FinishOverloadedCallExpr(clang::Sema&, clang::Scope*, clang::Expr*, clang::UnresolvedLookupExpr*, clang::SourceLocation, llvm::MutableArrayRef<clang::Expr*>, clang::SourceLocation, clang::Expr*, clang::OverloadCandidateSet*, clang::OverloadCandidate**, clang::OverloadingResult, bool) SemaOverload.cpp:0:0
 #62 0x00000000070626f4 clang::Sema::BuildOverloadedCallExpr(clang::Scope*, clang::Expr*, clang::UnresolvedLookupExpr*, clang::SourceLocation, llvm::MutableArrayRef<clang::Expr*>, clang::SourceLocation, clang::Expr*, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x70626f4)
 #63 0x0000000006c159a8 clang::Sema::BuildCallExpr(clang::Scope*, clang::Expr*, clang::SourceLocation, llvm::MutableArrayRef<clang::Expr*>, clang::SourceLocation, clang::Expr*, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6c159a8)
 #64 0x0000000006c17f0c clang::Sema::ActOnCallExpr(clang::Scope*, clang::Expr*, clang::SourceLocation, llvm::MutableArrayRef<clang::Expr*>, clang::SourceLocation, clang::Expr*) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6c17f0c)
 #65 0x0000000007306ac1 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformCallExpr(clang::CallExpr*) SemaTemplateInstantiate.cpp:0:0
 #66 0x00000000072fa327 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformExpr(clang::Expr*) SemaTemplateInstantiate.cpp:0:0
 #67 0x00000000073396ff clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformStmt(clang::Stmt*, clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::StmtDiscardKind) SemaTemplateInstantiate.cpp:0:0
 #68 0x0000000007339ec4 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformCompoundStmt(clang::CompoundStmt*, bool) SemaTemplateInstantiate.cpp:0:0
 #69 0x0000000007341964 clang::Sema::SubstStmt(clang::Stmt*, clang::MultiLevelTemplateArgumentList const&) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x7341964)
 #70 0x00000000073af5d9 clang::Sema::InstantiateFunctionDefinition(clang::SourceLocation, clang::FunctionDecl*, bool, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x73af5d9)
 #71 0x0000000006bf3399 void llvm::function_ref<void ()>::callback_fn<clang::Sema::MarkFunctionReferenced(clang::SourceLocation, clang::FunctionDecl*, bool)::'lambda'()>(long) SemaExpr.cpp:0:0
 #72 0x000000000677ac21 clang::Sema::runWithSufficientStackSpace(clang::SourceLocation, llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x677ac21)
 #73 0x0000000006be793f clang::Sema::MarkFunctionReferenced(clang::SourceLocation, clang::FunctionDecl*, bool) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6be793f)
 #74 0x0000000006a4c89c clang::Sema::BuildCXXConstructExpr(clang::SourceLocation, clang::QualType, clang::CXXConstructorDecl*, bool, llvm::MutableArrayRef<clang::Expr*>, bool, bool, bool, bool, clang::CXXConstructionKind, clang::SourceRange) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6a4c89c)
 #75 0x0000000006aeb154 clang::Sema::BuildCXXConstructExpr(clang::SourceLocation, clang::QualType, clang::NamedDecl*, clang::CXXConstructorDecl*, llvm::MutableArrayRef<clang::Expr*>, bool, bool, bool, bool, clang::CXXConstructionKind, clang::SourceRange) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6aeb154)
 #76 0x0000000006e045cd PerformConstructorInitialization(clang::Sema&, clang::InitializedEntity const&, clang::InitializationKind const&, llvm::MutableArrayRef<clang::Expr*>, clang::InitializationSequence::Step const&, bool&, bool, bool, clang::SourceLocation, clang::SourceLocation) SemaInit.cpp:0:0
 #77 0x0000000006e138ba clang::InitializationSequence::Perform(clang::Sema&, clang::InitializedEntity const&, clang::InitializationKind const&, llvm::MutableArrayRef<clang::Expr*>, clang::QualType*) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6e138ba)
 #78 0x0000000006a520af BuildImplicitBaseInitializer(clang::Sema&, clang::CXXConstructorDecl*, ImplicitInitializerKind, clang::CXXBaseSpecifier*, bool, clang::CXXCtorInitializer*&) SemaDeclCXX.cpp:0:0
 #79 0x0000000006a99ad5 clang::Sema::SetCtorInitializers(clang::CXXConstructorDecl*, bool, llvm::ArrayRef<clang::CXXCtorInitializer*>) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6a99ad5)
 #80 0x0000000006aef60c clang::Sema::DefineImplicitCopyConstructor(clang::SourceLocation, clang::CXXConstructorDecl*) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6aef60c)
 #81 0x0000000006bf375b void llvm::function_ref<void ()>::callback_fn<clang::Sema::MarkFunctionReferenced(clang::SourceLocation, clang::FunctionDecl*, bool)::'lambda'()>(long) SemaExpr.cpp:0:0
 #82 0x000000000677ac21 clang::Sema::runWithSufficientStackSpace(clang::SourceLocation, llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x677ac21)
 #83 0x0000000006be793f clang::Sema::MarkFunctionReferenced(clang::SourceLocation, clang::FunctionDecl*, bool) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6be793f)
 #84 0x0000000006a4c89c clang::Sema::BuildCXXConstructExpr(clang::SourceLocation, clang::QualType, clang::CXXConstructorDecl*, bool, llvm::MutableArrayRef<clang::Expr*>, bool, bool, bool, bool, clang::CXXConstructionKind, clang::SourceRange) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6a4c89c)
 #85 0x0000000006aeb154 clang::Sema::BuildCXXConstructExpr(clang::SourceLocation, clang::QualType, clang::NamedDecl*, clang::CXXConstructorDecl*, llvm::MutableArrayRef<clang::Expr*>, bool, bool, bool, bool, clang::CXXConstructionKind, clang::SourceRange) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6aeb154)
 #86 0x0000000006e045cd PerformConstructorInitialization(clang::Sema&, clang::InitializedEntity const&, clang::InitializationKind const&, llvm::MutableArrayRef<clang::Expr*>, clang::InitializationSequence::Step const&, bool&, bool, bool, clang::SourceLocation, clang::SourceLocation) SemaInit.cpp:0:0
 #87 0x0000000006e138ba clang::InitializationSequence::Perform(clang::Sema&, clang::InitializedEntity const&, clang::InitializationKind const&, llvm::MutableArrayRef<clang::Expr*>, clang::QualType*) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6e138ba)
 #88 0x0000000006a520af BuildImplicitBaseInitializer(clang::Sema&, clang::CXXConstructorDecl*, ImplicitInitializerKind, clang::CXXBaseSpecifier*, bool, clang::CXXCtorInitializer*&) SemaDeclCXX.cpp:0:0
 #89 0x0000000006a99ad5 clang::Sema::SetCtorInitializers(clang::CXXConstructorDecl*, bool, llvm::ArrayRef<clang::CXXCtorInitializer*>) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6a99ad5)
 #90 0x0000000006aef60c clang::Sema::DefineImplicitCopyConstructor(clang::SourceLocation, clang::CXXConstructorDecl*) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6aef60c)
 #91 0x0000000006bf375b void llvm::function_ref<void ()>::callback_fn<clang::Sema::MarkFunctionReferenced(clang::SourceLocation, clang::FunctionDecl*, bool)::'lambda'()>(long) SemaExpr.cpp:0:0
 #92 0x000000000677ac21 clang::Sema::runWithSufficientStackSpace(clang::SourceLocation, llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x677ac21)
 #93 0x0000000006be793f clang::Sema::MarkFunctionReferenced(clang::SourceLocation, clang::FunctionDecl*, bool) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6be793f)
 #94 0x0000000006a4c89c clang::Sema::BuildCXXConstructExpr(clang::SourceLocation, clang::QualType, clang::CXXConstructorDecl*, bool, llvm::MutableArrayRef<clang::Expr*>, bool, bool, bool, bool, clang::CXXConstructionKind, clang::SourceRange) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6a4c89c)
 #95 0x0000000006aeb154 clang::Sema::BuildCXXConstructExpr(clang::SourceLocation, clang::QualType, clang::NamedDecl*, clang::CXXConstructorDecl*, llvm::MutableArrayRef<clang::Expr*>, bool, bool, bool, bool, clang::CXXConstructionKind, clang::SourceRange) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6aeb154)
 #96 0x0000000006e045cd PerformConstructorInitialization(clang::Sema&, clang::InitializedEntity const&, clang::InitializationKind const&, llvm::MutableArrayRef<clang::Expr*>, clang::InitializationSequence::Step const&, bool&, bool, bool, clang::SourceLocation, clang::SourceLocation) SemaInit.cpp:0:0
 #97 0x0000000006e138ba clang::InitializationSequence::Perform(clang::Sema&, clang::InitializedEntity const&, clang::InitializationKind const&, llvm::MutableArrayRef<clang::Expr*>, clang::QualType*) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6e138ba)
 #98 0x0000000006a520af BuildImplicitBaseInitializer(clang::Sema&, clang::CXXConstructorDecl*, ImplicitInitializerKind, clang::CXXBaseSpecifier*, bool, clang::CXXCtorInitializer*&) SemaDeclCXX.cpp:0:0
 #99 0x0000000006a99ad5 clang::Sema::SetCtorInitializers(clang::CXXConstructorDecl*, bool, llvm::ArrayRef<clang::CXXCtorInitializer*>) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6a99ad5)
#100 0x0000000006aef60c clang::Sema::DefineImplicitCopyConstructor(clang::SourceLocation, clang::CXXConstructorDecl*) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6aef60c)
#101 0x0000000006bf375b void llvm::function_ref<void ()>::callback_fn<clang::Sema::MarkFunctionReferenced(clang::SourceLocation, clang::FunctionDecl*, bool)::'lambda'()>(long) SemaExpr.cpp:0:0
#102 0x000000000677ac21 clang::Sema::runWithSufficientStackSpace(clang::SourceLocation, llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x677ac21)
#103 0x0000000006be793f clang::Sema::MarkFunctionReferenced(clang::SourceLocation, clang::FunctionDecl*, bool) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6be793f)
#104 0x0000000006a4c89c clang::Sema::BuildCXXConstructExpr(clang::SourceLocation, clang::QualType, clang::CXXConstructorDecl*, bool, llvm::MutableArrayRef<clang::Expr*>, bool, bool, bool, bool, clang::CXXConstructionKind, clang::SourceRange) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6a4c89c)
#105 0x0000000006aeb154 clang::Sema::BuildCXXConstructExpr(clang::SourceLocation, clang::QualType, clang::NamedDecl*, clang::CXXConstructorDecl*, llvm::MutableArrayRef<clang::Expr*>, bool, bool, bool, bool, clang::CXXConstructionKind, clang::SourceRange) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6aeb154)
#106 0x0000000006e045cd PerformConstructorInitialization(clang::Sema&, clang::InitializedEntity const&, clang::InitializationKind const&, llvm::MutableArrayRef<clang::Expr*>, clang::InitializationSequence::Step const&, bool&, bool, bool, clang::SourceLocation, clang::SourceLocation) SemaInit.cpp:0:0
#107 0x0000000006e138ba clang::InitializationSequence::Perform(clang::Sema&, clang::InitializedEntity const&, clang::InitializationKind const&, llvm::MutableArrayRef<clang::Expr*>, clang::QualType*) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6e138ba)
#108 0x0000000006a520af BuildImplicitBaseInitializer(clang::Sema&, clang::CXXConstructorDecl*, ImplicitInitializerKind, clang::CXXBaseSpecifier*, bool, clang::CXXCtorInitializer*&) SemaDeclCXX.cpp:0:0
#109 0x0000000006a99ad5 clang::Sema::SetCtorInitializers(clang::CXXConstructorDecl*, bool, llvm::ArrayRef<clang::CXXCtorInitializer*>) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6a99ad5)
#110 0x0000000006aef60c clang::Sema::DefineImplicitCopyConstructor(clang::SourceLocation, clang::CXXConstructorDecl*) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6aef60c)
#111 0x0000000006bf375b void llvm::function_ref<void ()>::callback_fn<clang::Sema::MarkFunctionReferenced(clang::SourceLocation, clang::FunctionDecl*, bool)::'lambda'()>(long) SemaExpr.cpp:0:0
#112 0x000000000677ac21 clang::Sema::runWithSufficientStackSpace(clang::SourceLocation, llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x677ac21)
#113 0x0000000006be793f clang::Sema::MarkFunctionReferenced(clang::SourceLocation, clang::FunctionDecl*, bool) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6be793f)
#114 0x0000000006a4c89c clang::Sema::BuildCXXConstructExpr(clang::SourceLocation, clang::QualType, clang::CXXConstructorDecl*, bool, llvm::MutableArrayRef<clang::Expr*>, bool, bool, bool, bool, clang::CXXConstructionKind, clang::SourceRange) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6a4c89c)
#115 0x0000000006aeb154 clang::Sema::BuildCXXConstructExpr(clang::SourceLocation, clang::QualType, clang::NamedDecl*, clang::CXXConstructorDecl*, llvm::MutableArrayRef<clang::Expr*>, bool, bool, bool, bool, clang::CXXConstructionKind, clang::SourceRange) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6aeb154)
#116 0x0000000006e045cd PerformConstructorInitialization(clang::Sema&, clang::InitializedEntity const&, clang::InitializationKind const&, llvm::MutableArrayRef<clang::Expr*>, clang::InitializationSequence::Step const&, bool&, bool, bool, clang::SourceLocation, clang::SourceLocation) SemaInit.cpp:0:0
#117 0x0000000006e138ba clang::InitializationSequence::Perform(clang::Sema&, clang::InitializedEntity const&, clang::InitializationKind const&, llvm::MutableArrayRef<clang::Expr*>, clang::QualType*) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6e138ba)
#118 0x0000000006a520af BuildImplicitBaseInitializer(clang::Sema&, clang::CXXConstructorDecl*, ImplicitInitializerKind, clang::CXXBaseSpecifier*, bool, clang::CXXCtorInitializer*&) SemaDeclCXX.cpp:0:0
#119 0x0000000006a99ad5 clang::Sema::SetCtorInitializers(clang::CXXConstructorDecl*, bool, llvm::ArrayRef<clang::CXXCtorInitializer*>) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6a99ad5)
#120 0x0000000006aef60c clang::Sema::DefineImplicitCopyConstructor(clang::SourceLocation, clang::CXXConstructorDecl*) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6aef60c)
#121 0x0000000006bf375b void llvm::function_ref<void ()>::callback_fn<clang::Sema::MarkFunctionReferenced(clang::SourceLocation, clang::FunctionDecl*, bool)::'lambda'()>(long) SemaExpr.cpp:0:0
#122 0x000000000677ac21 clang::Sema::runWithSufficientStackSpace(clang::SourceLocation, llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x677ac21)
#123 0x0000000006be793f clang::Sema::MarkFunctionReferenced(clang::SourceLocation, clang::FunctionDecl*, bool) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6be793f)
#124 0x0000000006a4c89c clang::Sema::BuildCXXConstructExpr(clang::SourceLocation, clang::QualType, clang::CXXConstructorDecl*, bool, llvm::MutableArrayRef<clang::Expr*>, bool, bool, bool, bool, clang::CXXConstructionKind, clang::SourceRange) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6a4c89c)
#125 0x0000000006aeb154 clang::Sema::BuildCXXConstructExpr(clang::SourceLocation, clang::QualType, clang::NamedDecl*, clang::CXXConstructorDecl*, llvm::MutableArrayRef<clang::Expr*>, bool, bool, bool, bool, clang::CXXConstructionKind, clang::SourceRange) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6aeb154)
#126 0x0000000006e045cd PerformConstructorInitialization(clang::Sema&, clang::InitializedEntity const&, clang::InitializationKind const&, llvm::MutableArrayRef<clang::Expr*>, clang::InitializationSequence::Step const&, bool&, bool, bool, clang::SourceLocation, clang::SourceLocation) SemaInit.cpp:0:0
#127 0x0000000006e138ba clang::InitializationSequence::Perform(clang::Sema&, clang::InitializedEntity const&, clang::InitializationKind const&, llvm::MutableArrayRef<clang::Expr*>, clang::QualType*) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6e138ba)
#128 0x00000000069b8129 clang::Sema::AddInitializerToDecl(clang::Decl*, clang::Expr*, bool) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x69b8129)
#129 0x000000000663b78a clang::Parser::ParseDeclarationAfterDeclaratorAndAttributes(clang::Declarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::ForRangeInit*) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x663b78a)
#130 0x000000000664a769 clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, clang::DeclaratorContext, clang::ParsedAttributes&, clang::Parser::ParsedTemplateInfo&, clang::SourceLocation*, clang::Parser::ForRangeInit*) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x664a769)
#131 0x0000000006653087 clang::Parser::ParseSimpleDeclaration(clang::DeclaratorContext, clang::SourceLocation&, clang::ParsedAttributes&, clang::ParsedAttributes&, bool, clang::Parser::ForRangeInit*, clang::SourceLocation*) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6653087)
#132 0x0000000006653549 clang::Parser::ParseDeclaration(clang::DeclaratorContext, clang::SourceLocation&, clang::ParsedAttributes&, clang::ParsedAttributes&, clang::SourceLocation*) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6653549)
#133 0x00000000066ff7c2 clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*, clang::ParsedAttributes&, clang::ParsedAttributes&) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x66ff7c2)
#134 0x00000000067004f0 clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x67004f0)
#135 0x00000000067013c5 clang::Parser::ParseCompoundStatementBody(bool) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x67013c5)
#136 0x0000000006702b1a clang::Parser::ParseFunctionStatementBody(clang::Decl*, clang::Parser::ParseScope&) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6702b1a)
#137 0x0000000006615923 clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6615923)
#138 0x000000000664b14d clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, clang::DeclaratorContext, clang::ParsedAttributes&, clang::Parser::ParsedTemplateInfo&, clang::SourceLocation*, clang::Parser::ForRangeInit*) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x664b14d)
#139 0x000000000660966e clang::Parser::ParseDeclOrFunctionDefInternal(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec&, clang::AccessSpecifier) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x660966e)
#140 0x0000000006609e2e clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*, clang::AccessSpecifier) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6609e2e)
#141 0x00000000066115c3 clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x66115c3)
#142 0x00000000066124ad clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x66124ad)
#143 0x00000000066049ca clang::ParseAST(clang::Sema&, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x66049ca)
#144 0x000000000479ca99 clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x479ca99)
#145 0x000000000471b31e clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x471b31e)
#146 0x00000000048825be clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x48825be)
#147 0x0000000000cd452f cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0xcd452f)
#148 0x0000000000ccc23a ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) driver.cpp:0:0
#149 0x0000000000cd0b7e clang_main(int, char**, llvm::ToolContext const&) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0xcd0b7e)
#150 0x0000000000ba0c24 main (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0xba0c24)
#151 0x00007530a7a29d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#152 0x00007530a7a29e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#153 0x0000000000ccbcee _start (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0xccbcee)
@Sirraide Sirraide added clang:frontend Language frontend issues, e.g. anything involving "Sema" clang:modules C++20 modules and Clang Header Modules labels Sep 29, 2024
@llvmbot
Copy link
Member

llvmbot commented Sep 29, 2024

@llvm/issue-subscribers-clang-frontend

Author: None (Sirraide)

Given `a.ccm`: ```c++ module; #include <variant> #include <string> export module A;

export using Foo = std::variant<int, std::string, std::monostate>;
struct S {
Foo x = std::monostate{};
};


and `b.ccm`:
```c++
module;
#include &lt;variant&gt;
export module B;
import A;

void f() {
    Foo x;
    auto y = x;
}

Attempting to compile this asserts on trunk (https://godbolt.org/z/sqWax9eKq). I have not been able to reproduce this w/o modules (yet, but I’ll keep trying). #102353 seems to be the same assertion, but I’m not sure they’re related.

/root/llvm-project/clang/lib/Sema/SemaTemplateInstantiate.cpp:4439: 
llvm::PointerUnion&lt;clang::Decl*, llvm::SmallVector&lt;clang::VarDecl*, 4&gt;*&gt;* 
clang::LocalInstantiationScope::findInstantiationOf(const clang::Decl*): 
Assertion `isa&lt;LabelDecl&gt;(D) &amp;&amp; "declaration not instantiated in this scope"' failed.

Invocation:

/opt/compiler-explorer/clang-assertions-trunk/bin/clang++ --gcc-toolchain=/opt/compiler-explorer/gcc-snapshot   -fcolor-diagnostics -fno-crash-diagnostics -isystem/opt/compiler-explorer/libs/fmt/7.1.3/include -O2 -g -DNDEBUG -std=gnu++26 -MD -MT CMakeFiles/bug.dir/b.ccm.o -MF CMakeFiles/bug.dir/b.ccm.o.d @<!-- -->CMakeFiles/bug.dir/b.ccm.o.modmap -o CMakeFiles/bug.dir/b.ccm.o -c /app/b.ccm

It’s clearly crashing in b.ccm, but that might be due to a faulty module being emitted for a.ccm. I’m unfortunately not that familiar w/ our modules implementation, so I don’t know which one is more likely.

Stack trace:

Stack dump:
0.	Program arguments: /opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20 -cc1 -triple x86_64-unknown-linux-gnu -emit-module-interface -disable-free -clear-ast-before-backend -main-file-name b.ccm -mrelocation-model pic -pic-level 2 -pic-is-pie -mframe-pointer=none -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debug-info-kind=constructor -dwarf-version=5 -debugger-tuning=gdb -fdebug-compilation-dir=/app/build -fcoverage-compilation-dir=/app/build -resource-dir /opt/compiler-explorer/clang-assertions-trunk-20240928/lib/clang/20 -dependency-file CMakeFiles/bug.dir/b.ccm.o.d -MT CMakeFiles/bug.dir/b.ccm.o -sys-header-deps -module-file-deps -isystem /opt/compiler-explorer/libs/fmt/7.1.3/include -D NDEBUG -internal-isystem /opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/15.0.0/../../../../include/c++/15.0.0 -internal-isystem /opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/15.0.0/../../../../include/c++/15.0.0/x86_64-linux-gnu -internal-isystem /opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/15.0.0/../../../../include/c++/15.0.0/backward -internal-isystem /opt/compiler-explorer/clang-assertions-trunk-20240928/lib/clang/20/include -internal-isystem /usr/local/include -internal-isystem /opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/15.0.0/../../../../x86_64-linux-gnu/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -O2 -std=gnu++26 -fdeprecated-macro -ferror-limit 19 -fgnuc-version=4.2.1 -fno-implicit-modules -fmodule-file=A=CMakeFiles/bug.dir/A.pcm -fskip-odr-check-in-gmf -fcxx-exceptions -fexceptions -fcolor-diagnostics -vectorize-loops -vectorize-slp -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o CMakeFiles/bug.dir/B.pcm -x c++ /app/b.ccm
1.	/app/b.ccm:8:15: current parser token ';'
2.	/app/b.ccm:6:10: parsing function body 'f'
3.	/app/b.ccm:6:10: in compound statement ('{}')
4.	/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/15.0.0/../../../../include/c++/15.0.0/variant:582:7: instantiating function definition 'std::__detail::__variant::_Copy_ctor_base&lt;false, int, std::basic_string&lt;char&gt;, std::monostate&gt;::_Copy_ctor_base'
5.	/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/15.0.0/../../../../include/c++/15.0.0/variant:185:5: instantiating function definition 'std::__detail::__variant::__raw_idx_visit&lt;(lambda at /opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/15.0.0/../../../../include/c++/15.0.0/variant:586:4), const std::variant&lt;int, std::basic_string&lt;char&gt;, std::monostate&gt; &amp;&gt;'
6.	/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/15.0.0/../../../../include/c++/15.0.0/variant:1844:5: instantiating function definition 'std::__do_visit&lt;std::__detail::__variant::__variant_idx_cookie, (lambda at /opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/15.0.0/../../../../include/c++/15.0.0/variant:586:4), const std::variant&lt;int, std::basic_string&lt;char&gt;, std::monostate&gt; &amp;&gt;'
  #<!-- -->0 0x0000000003b8cab8 llvm::sys::PrintStackTrace(llvm::raw_ostream&amp;, int) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x3b8cab8)
  #<!-- -->1 0x0000000003b8a46c SignalHandler(int) Signals.cpp:0:0
  #<!-- -->2 0x00007530a7a42520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
  #<!-- -->3 0x00007530a7a969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
  #<!-- -->4 0x00007530a7a42476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
  #<!-- -->5 0x00007530a7a287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
  #<!-- -->6 0x00007530a7a2871b (/lib/x86_64-linux-gnu/libc.so.6+0x2871b)
  #<!-- -->7 0x00007530a7a39e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
  #<!-- -->8 0x00000000072eac9e clang::LocalInstantiationScope::findInstantiationOf(clang::Decl const*) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x72eac9e)
  #<!-- -->9 0x00000000073a81a7 clang::Sema::FindInstantiatedDecl(clang::SourceLocation, clang::NamedDecl*, clang::MultiLevelTemplateArgumentList const&amp;, bool) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x73a81a7)
 #<!-- -->10 0x00000000072d75c1 (anonymous namespace)::TemplateInstantiator::TransformDecl(clang::SourceLocation, clang::Decl*) SemaTemplateInstantiate.cpp:0:0
 #<!-- -->11 0x000000000730bf58 clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::TransformType(clang::TypeLocBuilder&amp;, clang::TypeLoc) SemaTemplateInstantiate.cpp:0:0
 #<!-- -->12 0x000000000732c654 clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::TransformElaboratedType(clang::TypeLocBuilder&amp;, clang::ElaboratedTypeLoc) SemaTemplateInstantiate.cpp:0:0
 #<!-- -->13 0x000000000730b643 clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::TransformType(clang::TypeLocBuilder&amp;, clang::TypeLoc) SemaTemplateInstantiate.cpp:0:0
 #<!-- -->14 0x00000000073116bd clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::TransformReferenceType(clang::TypeLocBuilder&amp;, clang::ReferenceTypeLoc) SemaTemplateInstantiate.cpp:0:0
 #<!-- -->15 0x000000000730bbfc clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::TransformType(clang::TypeLocBuilder&amp;, clang::TypeLoc) SemaTemplateInstantiate.cpp:0:0
 #<!-- -->16 0x0000000007311e0a clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::TransformType(clang::TypeSourceInfo*) SemaTemplateInstantiate.cpp:0:0
 #<!-- -->17 0x00000000073207f6 clang::Sema::SubstType(clang::TypeSourceInfo*, clang::MultiLevelTemplateArgumentList const&amp;, clang::SourceLocation, clang::DeclarationName, bool) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x73207f6)
 #<!-- -->18 0x000000000732f345 clang::Sema::SubstParmVarDecl(clang::ParmVarDecl*, clang::MultiLevelTemplateArgumentList const&amp;, int, std::optional&lt;unsigned int&gt;, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x732f345)
 #<!-- -->19 0x00000000073309e0 clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::TransformFunctionTypeParams(clang::SourceLocation, llvm::ArrayRef&lt;clang::ParmVarDecl*&gt;, clang::QualType const*, clang::FunctionType::ExtParameterInfo const*, llvm::SmallVectorImpl&lt;clang::QualType&gt;&amp;, llvm::SmallVectorImpl&lt;clang::ParmVarDecl*&gt;*, clang::Sema::ExtParameterInfoBuilder&amp;, unsigned int*) SemaTemplateInstantiate.cpp:0:0
 #<!-- -->20 0x000000000730a22f clang::QualType clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::TransformFunctionProtoType&lt;clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::TransformFunctionProtoType(clang::TypeLocBuilder&amp;, clang::FunctionProtoTypeLoc)::'lambda'(clang::FunctionProtoType::ExceptionSpecInfo&amp;, bool&amp;)&gt;(clang::TypeLocBuilder&amp;, clang::FunctionProtoTypeLoc, clang::CXXRecordDecl*, clang::Qualifiers, clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::TransformFunctionProtoType(clang::TypeLocBuilder&amp;, clang::FunctionProtoTypeLoc)::'lambda'(clang::FunctionProtoType::ExceptionSpecInfo&amp;, bool&amp;)) (.constprop.0) SemaTemplateInstantiate.cpp:0:0
 #<!-- -->21 0x000000000730b7b4 clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::TransformType(clang::TypeLocBuilder&amp;, clang::TypeLoc) SemaTemplateInstantiate.cpp:0:0
 #<!-- -->22 0x00000000072f8a51 clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::TransformLambdaExpr(clang::LambdaExpr*) SemaTemplateInstantiate.cpp:0:0
 #<!-- -->23 0x00000000072fa7cd clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::TransformExpr(clang::Expr*) SemaTemplateInstantiate.cpp:0:0
 #<!-- -->24 0x00000000073069ee clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::TransformCallExpr(clang::CallExpr*) SemaTemplateInstantiate.cpp:0:0
 #<!-- -->25 0x00000000072fa327 clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::TransformExpr(clang::Expr*) SemaTemplateInstantiate.cpp:0:0
 #<!-- -->26 0x00000000072fc058 clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::TransformInitializer(clang::Expr*, bool) (.part.0) SemaTemplateInstantiate.cpp:0:0
 #<!-- -->27 0x00000000072fc67b clang::Sema::SubstInitializer(clang::Expr*, clang::MultiLevelTemplateArgumentList const&amp;, bool) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x72fc67b)
 #<!-- -->28 0x00000000073647d6 clang::Sema::InstantiateVariableInitializer(clang::VarDecl*, clang::VarDecl*, clang::MultiLevelTemplateArgumentList const&amp;) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x73647d6)
 #<!-- -->29 0x00000000073ab910 clang::Sema::BuildVariableInstantiation(clang::VarDecl*, clang::VarDecl*, clang::MultiLevelTemplateArgumentList const&amp;, llvm::SmallVector&lt;clang::Sema::LateInstantiatedAttribute, 16u&gt;*, clang::DeclContext*, clang::LocalInstantiationScope*, bool, clang::VarTemplateSpecializationDecl*) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x73ab910)
 #<!-- -->30 0x00000000073b5e17 clang::TemplateDeclInstantiator::VisitVarDecl(clang::VarDecl*, bool, llvm::ArrayRef&lt;clang::BindingDecl*&gt;*) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x73b5e17)
 #<!-- -->31 0x00000000073baf44 void llvm::function_ref&lt;void ()&gt;::callback_fn&lt;clang::Sema::SubstDecl(clang::Decl*, clang::DeclContext*, clang::MultiLevelTemplateArgumentList const&amp;)::'lambda'()&gt;(long) SemaTemplateInstantiateDecl.cpp:0:0
 #<!-- -->32 0x000000000677ac21 clang::Sema::runWithSufficientStackSpace(clang::SourceLocation, llvm::function_ref&lt;void ()&gt;) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x677ac21)
 #<!-- -->33 0x00000000073626ba clang::Sema::SubstDecl(clang::Decl*, clang::DeclContext*, clang::MultiLevelTemplateArgumentList const&amp;) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x73626ba)
 #<!-- -->34 0x00000000072eba15 clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::TransformDeclStmt(clang::DeclStmt*) SemaTemplateInstantiate.cpp:0:0
 #<!-- -->35 0x0000000007339ec4 clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::TransformCompoundStmt(clang::CompoundStmt*, bool) SemaTemplateInstantiate.cpp:0:0
 #<!-- -->36 0x000000000733fe97 clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::TransformIfStmt(clang::IfStmt*) SemaTemplateInstantiate.cpp:0:0
 #<!-- -->37 0x0000000007339ec4 clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::TransformCompoundStmt(clang::CompoundStmt*, bool) SemaTemplateInstantiate.cpp:0:0
 #<!-- -->38 0x000000000733fe97 clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::TransformIfStmt(clang::IfStmt*) SemaTemplateInstantiate.cpp:0:0
 #<!-- -->39 0x0000000007339ec4 clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::TransformCompoundStmt(clang::CompoundStmt*, bool) SemaTemplateInstantiate.cpp:0:0
 #<!-- -->40 0x0000000007341964 clang::Sema::SubstStmt(clang::Stmt*, clang::MultiLevelTemplateArgumentList const&amp;) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x7341964)
 #<!-- -->41 0x00000000073af5d9 clang::Sema::InstantiateFunctionDefinition(clang::SourceLocation, clang::FunctionDecl*, bool, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x73af5d9)
 #<!-- -->42 0x000000000677ac21 clang::Sema::runWithSufficientStackSpace(clang::SourceLocation, llvm::function_ref&lt;void ()&gt;) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x677ac21)
 #<!-- -->43 0x00000000071e24e2 clang::Sema::DeduceReturnType(clang::FunctionDecl*, clang::SourceLocation, bool) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x71e24e2)
 #<!-- -->44 0x0000000006b9e4a5 clang::Sema::DiagnoseUseOfDecl(clang::NamedDecl*, llvm::ArrayRef&lt;clang::SourceLocation&gt;, clang::ObjCInterfaceDecl const*, bool, bool, clang::ObjCInterfaceDecl*, bool) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6b9e4a5)
 #<!-- -->45 0x0000000007061844 FinishOverloadedCallExpr(clang::Sema&amp;, clang::Scope*, clang::Expr*, clang::UnresolvedLookupExpr*, clang::SourceLocation, llvm::MutableArrayRef&lt;clang::Expr*&gt;, clang::SourceLocation, clang::Expr*, clang::OverloadCandidateSet*, clang::OverloadCandidate**, clang::OverloadingResult, bool) SemaOverload.cpp:0:0
 #<!-- -->46 0x00000000070626f4 clang::Sema::BuildOverloadedCallExpr(clang::Scope*, clang::Expr*, clang::UnresolvedLookupExpr*, clang::SourceLocation, llvm::MutableArrayRef&lt;clang::Expr*&gt;, clang::SourceLocation, clang::Expr*, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x70626f4)
 #<!-- -->47 0x0000000006c159a8 clang::Sema::BuildCallExpr(clang::Scope*, clang::Expr*, clang::SourceLocation, llvm::MutableArrayRef&lt;clang::Expr*&gt;, clang::SourceLocation, clang::Expr*, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6c159a8)
 #<!-- -->48 0x0000000006c17f0c clang::Sema::ActOnCallExpr(clang::Scope*, clang::Expr*, clang::SourceLocation, llvm::MutableArrayRef&lt;clang::Expr*&gt;, clang::SourceLocation, clang::Expr*) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6c17f0c)
 #<!-- -->49 0x0000000007306ac1 clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::TransformCallExpr(clang::CallExpr*) SemaTemplateInstantiate.cpp:0:0
 #<!-- -->50 0x00000000072fa327 clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::TransformExpr(clang::Expr*) SemaTemplateInstantiate.cpp:0:0
 #<!-- -->51 0x00000000073396ff clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::TransformStmt(clang::Stmt*, clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::StmtDiscardKind) SemaTemplateInstantiate.cpp:0:0
 #<!-- -->52 0x0000000007339ec4 clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::TransformCompoundStmt(clang::CompoundStmt*, bool) SemaTemplateInstantiate.cpp:0:0
 #<!-- -->53 0x0000000007341964 clang::Sema::SubstStmt(clang::Stmt*, clang::MultiLevelTemplateArgumentList const&amp;) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x7341964)
 #<!-- -->54 0x00000000073af5d9 clang::Sema::InstantiateFunctionDefinition(clang::SourceLocation, clang::FunctionDecl*, bool, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x73af5d9)
 #<!-- -->55 0x0000000006bf3399 void llvm::function_ref&lt;void ()&gt;::callback_fn&lt;clang::Sema::MarkFunctionReferenced(clang::SourceLocation, clang::FunctionDecl*, bool)::'lambda'()&gt;(long) SemaExpr.cpp:0:0
 #<!-- -->56 0x000000000677ac21 clang::Sema::runWithSufficientStackSpace(clang::SourceLocation, llvm::function_ref&lt;void ()&gt;) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x677ac21)
 #<!-- -->57 0x0000000006be793f clang::Sema::MarkFunctionReferenced(clang::SourceLocation, clang::FunctionDecl*, bool) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6be793f)
 #<!-- -->58 0x0000000006be7fcd MarkExprReferenced(clang::Sema&amp;, clang::SourceLocation, clang::Decl*, clang::Expr*, bool, llvm::DenseMap&lt;clang::VarDecl const*, int, llvm::DenseMapInfo&lt;clang::VarDecl const*, void&gt;, llvm::detail::DenseMapPair&lt;clang::VarDecl const*, int&gt;&gt;&amp;) SemaExpr.cpp:0:0
 #<!-- -->59 0x0000000006be8619 clang::Sema::BuildDeclRefExpr(clang::ValueDecl*, clang::QualType, clang::ExprValueKind, clang::DeclarationNameInfo const&amp;, clang::NestedNameSpecifierLoc, clang::NamedDecl*, clang::SourceLocation, clang::TemplateArgumentListInfo const*) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6be8619)
 #<!-- -->60 0x000000000702e36b clang::Sema::FixOverloadedFunctionReference(clang::Expr*, clang::DeclAccessPair, clang::FunctionDecl*) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x702e36b)
 #<!-- -->61 0x000000000706158e FinishOverloadedCallExpr(clang::Sema&amp;, clang::Scope*, clang::Expr*, clang::UnresolvedLookupExpr*, clang::SourceLocation, llvm::MutableArrayRef&lt;clang::Expr*&gt;, clang::SourceLocation, clang::Expr*, clang::OverloadCandidateSet*, clang::OverloadCandidate**, clang::OverloadingResult, bool) SemaOverload.cpp:0:0
 #<!-- -->62 0x00000000070626f4 clang::Sema::BuildOverloadedCallExpr(clang::Scope*, clang::Expr*, clang::UnresolvedLookupExpr*, clang::SourceLocation, llvm::MutableArrayRef&lt;clang::Expr*&gt;, clang::SourceLocation, clang::Expr*, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x70626f4)
 #<!-- -->63 0x0000000006c159a8 clang::Sema::BuildCallExpr(clang::Scope*, clang::Expr*, clang::SourceLocation, llvm::MutableArrayRef&lt;clang::Expr*&gt;, clang::SourceLocation, clang::Expr*, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6c159a8)
 #<!-- -->64 0x0000000006c17f0c clang::Sema::ActOnCallExpr(clang::Scope*, clang::Expr*, clang::SourceLocation, llvm::MutableArrayRef&lt;clang::Expr*&gt;, clang::SourceLocation, clang::Expr*) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6c17f0c)
 #<!-- -->65 0x0000000007306ac1 clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::TransformCallExpr(clang::CallExpr*) SemaTemplateInstantiate.cpp:0:0
 #<!-- -->66 0x00000000072fa327 clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::TransformExpr(clang::Expr*) SemaTemplateInstantiate.cpp:0:0
 #<!-- -->67 0x00000000073396ff clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::TransformStmt(clang::Stmt*, clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::StmtDiscardKind) SemaTemplateInstantiate.cpp:0:0
 #<!-- -->68 0x0000000007339ec4 clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::TransformCompoundStmt(clang::CompoundStmt*, bool) SemaTemplateInstantiate.cpp:0:0
 #<!-- -->69 0x0000000007341964 clang::Sema::SubstStmt(clang::Stmt*, clang::MultiLevelTemplateArgumentList const&amp;) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x7341964)
 #<!-- -->70 0x00000000073af5d9 clang::Sema::InstantiateFunctionDefinition(clang::SourceLocation, clang::FunctionDecl*, bool, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x73af5d9)
 #<!-- -->71 0x0000000006bf3399 void llvm::function_ref&lt;void ()&gt;::callback_fn&lt;clang::Sema::MarkFunctionReferenced(clang::SourceLocation, clang::FunctionDecl*, bool)::'lambda'()&gt;(long) SemaExpr.cpp:0:0
 #<!-- -->72 0x000000000677ac21 clang::Sema::runWithSufficientStackSpace(clang::SourceLocation, llvm::function_ref&lt;void ()&gt;) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x677ac21)
 #<!-- -->73 0x0000000006be793f clang::Sema::MarkFunctionReferenced(clang::SourceLocation, clang::FunctionDecl*, bool) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6be793f)
 #<!-- -->74 0x0000000006a4c89c clang::Sema::BuildCXXConstructExpr(clang::SourceLocation, clang::QualType, clang::CXXConstructorDecl*, bool, llvm::MutableArrayRef&lt;clang::Expr*&gt;, bool, bool, bool, bool, clang::CXXConstructionKind, clang::SourceRange) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6a4c89c)
 #<!-- -->75 0x0000000006aeb154 clang::Sema::BuildCXXConstructExpr(clang::SourceLocation, clang::QualType, clang::NamedDecl*, clang::CXXConstructorDecl*, llvm::MutableArrayRef&lt;clang::Expr*&gt;, bool, bool, bool, bool, clang::CXXConstructionKind, clang::SourceRange) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6aeb154)
 #<!-- -->76 0x0000000006e045cd PerformConstructorInitialization(clang::Sema&amp;, clang::InitializedEntity const&amp;, clang::InitializationKind const&amp;, llvm::MutableArrayRef&lt;clang::Expr*&gt;, clang::InitializationSequence::Step const&amp;, bool&amp;, bool, bool, clang::SourceLocation, clang::SourceLocation) SemaInit.cpp:0:0
 #<!-- -->77 0x0000000006e138ba clang::InitializationSequence::Perform(clang::Sema&amp;, clang::InitializedEntity const&amp;, clang::InitializationKind const&amp;, llvm::MutableArrayRef&lt;clang::Expr*&gt;, clang::QualType*) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6e138ba)
 #<!-- -->78 0x0000000006a520af BuildImplicitBaseInitializer(clang::Sema&amp;, clang::CXXConstructorDecl*, ImplicitInitializerKind, clang::CXXBaseSpecifier*, bool, clang::CXXCtorInitializer*&amp;) SemaDeclCXX.cpp:0:0
 #<!-- -->79 0x0000000006a99ad5 clang::Sema::SetCtorInitializers(clang::CXXConstructorDecl*, bool, llvm::ArrayRef&lt;clang::CXXCtorInitializer*&gt;) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6a99ad5)
 #<!-- -->80 0x0000000006aef60c clang::Sema::DefineImplicitCopyConstructor(clang::SourceLocation, clang::CXXConstructorDecl*) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6aef60c)
 #<!-- -->81 0x0000000006bf375b void llvm::function_ref&lt;void ()&gt;::callback_fn&lt;clang::Sema::MarkFunctionReferenced(clang::SourceLocation, clang::FunctionDecl*, bool)::'lambda'()&gt;(long) SemaExpr.cpp:0:0
 #<!-- -->82 0x000000000677ac21 clang::Sema::runWithSufficientStackSpace(clang::SourceLocation, llvm::function_ref&lt;void ()&gt;) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x677ac21)
 #<!-- -->83 0x0000000006be793f clang::Sema::MarkFunctionReferenced(clang::SourceLocation, clang::FunctionDecl*, bool) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6be793f)
 #<!-- -->84 0x0000000006a4c89c clang::Sema::BuildCXXConstructExpr(clang::SourceLocation, clang::QualType, clang::CXXConstructorDecl*, bool, llvm::MutableArrayRef&lt;clang::Expr*&gt;, bool, bool, bool, bool, clang::CXXConstructionKind, clang::SourceRange) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6a4c89c)
 #<!-- -->85 0x0000000006aeb154 clang::Sema::BuildCXXConstructExpr(clang::SourceLocation, clang::QualType, clang::NamedDecl*, clang::CXXConstructorDecl*, llvm::MutableArrayRef&lt;clang::Expr*&gt;, bool, bool, bool, bool, clang::CXXConstructionKind, clang::SourceRange) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6aeb154)
 #<!-- -->86 0x0000000006e045cd PerformConstructorInitialization(clang::Sema&amp;, clang::InitializedEntity const&amp;, clang::InitializationKind const&amp;, llvm::MutableArrayRef&lt;clang::Expr*&gt;, clang::InitializationSequence::Step const&amp;, bool&amp;, bool, bool, clang::SourceLocation, clang::SourceLocation) SemaInit.cpp:0:0
 #<!-- -->87 0x0000000006e138ba clang::InitializationSequence::Perform(clang::Sema&amp;, clang::InitializedEntity const&amp;, clang::InitializationKind const&amp;, llvm::MutableArrayRef&lt;clang::Expr*&gt;, clang::QualType*) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6e138ba)
 #<!-- -->88 0x0000000006a520af BuildImplicitBaseInitializer(clang::Sema&amp;, clang::CXXConstructorDecl*, ImplicitInitializerKind, clang::CXXBaseSpecifier*, bool, clang::CXXCtorInitializer*&amp;) SemaDeclCXX.cpp:0:0
 #<!-- -->89 0x0000000006a99ad5 clang::Sema::SetCtorInitializers(clang::CXXConstructorDecl*, bool, llvm::ArrayRef&lt;clang::CXXCtorInitializer*&gt;) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6a99ad5)
 #<!-- -->90 0x0000000006aef60c clang::Sema::DefineImplicitCopyConstructor(clang::SourceLocation, clang::CXXConstructorDecl*) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6aef60c)
 #<!-- -->91 0x0000000006bf375b void llvm::function_ref&lt;void ()&gt;::callback_fn&lt;clang::Sema::MarkFunctionReferenced(clang::SourceLocation, clang::FunctionDecl*, bool)::'lambda'()&gt;(long) SemaExpr.cpp:0:0
 #<!-- -->92 0x000000000677ac21 clang::Sema::runWithSufficientStackSpace(clang::SourceLocation, llvm::function_ref&lt;void ()&gt;) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x677ac21)
 #<!-- -->93 0x0000000006be793f clang::Sema::MarkFunctionReferenced(clang::SourceLocation, clang::FunctionDecl*, bool) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6be793f)
 #<!-- -->94 0x0000000006a4c89c clang::Sema::BuildCXXConstructExpr(clang::SourceLocation, clang::QualType, clang::CXXConstructorDecl*, bool, llvm::MutableArrayRef&lt;clang::Expr*&gt;, bool, bool, bool, bool, clang::CXXConstructionKind, clang::SourceRange) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6a4c89c)
 #<!-- -->95 0x0000000006aeb154 clang::Sema::BuildCXXConstructExpr(clang::SourceLocation, clang::QualType, clang::NamedDecl*, clang::CXXConstructorDecl*, llvm::MutableArrayRef&lt;clang::Expr*&gt;, bool, bool, bool, bool, clang::CXXConstructionKind, clang::SourceRange) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6aeb154)
 #<!-- -->96 0x0000000006e045cd PerformConstructorInitialization(clang::Sema&amp;, clang::InitializedEntity const&amp;, clang::InitializationKind const&amp;, llvm::MutableArrayRef&lt;clang::Expr*&gt;, clang::InitializationSequence::Step const&amp;, bool&amp;, bool, bool, clang::SourceLocation, clang::SourceLocation) SemaInit.cpp:0:0
 #<!-- -->97 0x0000000006e138ba clang::InitializationSequence::Perform(clang::Sema&amp;, clang::InitializedEntity const&amp;, clang::InitializationKind const&amp;, llvm::MutableArrayRef&lt;clang::Expr*&gt;, clang::QualType*) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6e138ba)
 #<!-- -->98 0x0000000006a520af BuildImplicitBaseInitializer(clang::Sema&amp;, clang::CXXConstructorDecl*, ImplicitInitializerKind, clang::CXXBaseSpecifier*, bool, clang::CXXCtorInitializer*&amp;) SemaDeclCXX.cpp:0:0
 #<!-- -->99 0x0000000006a99ad5 clang::Sema::SetCtorInitializers(clang::CXXConstructorDecl*, bool, llvm::ArrayRef&lt;clang::CXXCtorInitializer*&gt;) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6a99ad5)
#<!-- -->100 0x0000000006aef60c clang::Sema::DefineImplicitCopyConstructor(clang::SourceLocation, clang::CXXConstructorDecl*) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6aef60c)
#<!-- -->101 0x0000000006bf375b void llvm::function_ref&lt;void ()&gt;::callback_fn&lt;clang::Sema::MarkFunctionReferenced(clang::SourceLocation, clang::FunctionDecl*, bool)::'lambda'()&gt;(long) SemaExpr.cpp:0:0
#<!-- -->102 0x000000000677ac21 clang::Sema::runWithSufficientStackSpace(clang::SourceLocation, llvm::function_ref&lt;void ()&gt;) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x677ac21)
#<!-- -->103 0x0000000006be793f clang::Sema::MarkFunctionReferenced(clang::SourceLocation, clang::FunctionDecl*, bool) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6be793f)
#<!-- -->104 0x0000000006a4c89c clang::Sema::BuildCXXConstructExpr(clang::SourceLocation, clang::QualType, clang::CXXConstructorDecl*, bool, llvm::MutableArrayRef&lt;clang::Expr*&gt;, bool, bool, bool, bool, clang::CXXConstructionKind, clang::SourceRange) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6a4c89c)
#<!-- -->105 0x0000000006aeb154 clang::Sema::BuildCXXConstructExpr(clang::SourceLocation, clang::QualType, clang::NamedDecl*, clang::CXXConstructorDecl*, llvm::MutableArrayRef&lt;clang::Expr*&gt;, bool, bool, bool, bool, clang::CXXConstructionKind, clang::SourceRange) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6aeb154)
#<!-- -->106 0x0000000006e045cd PerformConstructorInitialization(clang::Sema&amp;, clang::InitializedEntity const&amp;, clang::InitializationKind const&amp;, llvm::MutableArrayRef&lt;clang::Expr*&gt;, clang::InitializationSequence::Step const&amp;, bool&amp;, bool, bool, clang::SourceLocation, clang::SourceLocation) SemaInit.cpp:0:0
#<!-- -->107 0x0000000006e138ba clang::InitializationSequence::Perform(clang::Sema&amp;, clang::InitializedEntity const&amp;, clang::InitializationKind const&amp;, llvm::MutableArrayRef&lt;clang::Expr*&gt;, clang::QualType*) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6e138ba)
#<!-- -->108 0x0000000006a520af BuildImplicitBaseInitializer(clang::Sema&amp;, clang::CXXConstructorDecl*, ImplicitInitializerKind, clang::CXXBaseSpecifier*, bool, clang::CXXCtorInitializer*&amp;) SemaDeclCXX.cpp:0:0
#<!-- -->109 0x0000000006a99ad5 clang::Sema::SetCtorInitializers(clang::CXXConstructorDecl*, bool, llvm::ArrayRef&lt;clang::CXXCtorInitializer*&gt;) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6a99ad5)
#<!-- -->110 0x0000000006aef60c clang::Sema::DefineImplicitCopyConstructor(clang::SourceLocation, clang::CXXConstructorDecl*) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6aef60c)
#<!-- -->111 0x0000000006bf375b void llvm::function_ref&lt;void ()&gt;::callback_fn&lt;clang::Sema::MarkFunctionReferenced(clang::SourceLocation, clang::FunctionDecl*, bool)::'lambda'()&gt;(long) SemaExpr.cpp:0:0
#<!-- -->112 0x000000000677ac21 clang::Sema::runWithSufficientStackSpace(clang::SourceLocation, llvm::function_ref&lt;void ()&gt;) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x677ac21)
#<!-- -->113 0x0000000006be793f clang::Sema::MarkFunctionReferenced(clang::SourceLocation, clang::FunctionDecl*, bool) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6be793f)
#<!-- -->114 0x0000000006a4c89c clang::Sema::BuildCXXConstructExpr(clang::SourceLocation, clang::QualType, clang::CXXConstructorDecl*, bool, llvm::MutableArrayRef&lt;clang::Expr*&gt;, bool, bool, bool, bool, clang::CXXConstructionKind, clang::SourceRange) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6a4c89c)
#<!-- -->115 0x0000000006aeb154 clang::Sema::BuildCXXConstructExpr(clang::SourceLocation, clang::QualType, clang::NamedDecl*, clang::CXXConstructorDecl*, llvm::MutableArrayRef&lt;clang::Expr*&gt;, bool, bool, bool, bool, clang::CXXConstructionKind, clang::SourceRange) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6aeb154)
#<!-- -->116 0x0000000006e045cd PerformConstructorInitialization(clang::Sema&amp;, clang::InitializedEntity const&amp;, clang::InitializationKind const&amp;, llvm::MutableArrayRef&lt;clang::Expr*&gt;, clang::InitializationSequence::Step const&amp;, bool&amp;, bool, bool, clang::SourceLocation, clang::SourceLocation) SemaInit.cpp:0:0
#<!-- -->117 0x0000000006e138ba clang::InitializationSequence::Perform(clang::Sema&amp;, clang::InitializedEntity const&amp;, clang::InitializationKind const&amp;, llvm::MutableArrayRef&lt;clang::Expr*&gt;, clang::QualType*) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6e138ba)
#<!-- -->118 0x0000000006a520af BuildImplicitBaseInitializer(clang::Sema&amp;, clang::CXXConstructorDecl*, ImplicitInitializerKind, clang::CXXBaseSpecifier*, bool, clang::CXXCtorInitializer*&amp;) SemaDeclCXX.cpp:0:0
#<!-- -->119 0x0000000006a99ad5 clang::Sema::SetCtorInitializers(clang::CXXConstructorDecl*, bool, llvm::ArrayRef&lt;clang::CXXCtorInitializer*&gt;) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6a99ad5)
#<!-- -->120 0x0000000006aef60c clang::Sema::DefineImplicitCopyConstructor(clang::SourceLocation, clang::CXXConstructorDecl*) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6aef60c)
#<!-- -->121 0x0000000006bf375b void llvm::function_ref&lt;void ()&gt;::callback_fn&lt;clang::Sema::MarkFunctionReferenced(clang::SourceLocation, clang::FunctionDecl*, bool)::'lambda'()&gt;(long) SemaExpr.cpp:0:0
#<!-- -->122 0x000000000677ac21 clang::Sema::runWithSufficientStackSpace(clang::SourceLocation, llvm::function_ref&lt;void ()&gt;) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x677ac21)
#<!-- -->123 0x0000000006be793f clang::Sema::MarkFunctionReferenced(clang::SourceLocation, clang::FunctionDecl*, bool) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6be793f)
#<!-- -->124 0x0000000006a4c89c clang::Sema::BuildCXXConstructExpr(clang::SourceLocation, clang::QualType, clang::CXXConstructorDecl*, bool, llvm::MutableArrayRef&lt;clang::Expr*&gt;, bool, bool, bool, bool, clang::CXXConstructionKind, clang::SourceRange) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6a4c89c)
#<!-- -->125 0x0000000006aeb154 clang::Sema::BuildCXXConstructExpr(clang::SourceLocation, clang::QualType, clang::NamedDecl*, clang::CXXConstructorDecl*, llvm::MutableArrayRef&lt;clang::Expr*&gt;, bool, bool, bool, bool, clang::CXXConstructionKind, clang::SourceRange) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6aeb154)
#<!-- -->126 0x0000000006e045cd PerformConstructorInitialization(clang::Sema&amp;, clang::InitializedEntity const&amp;, clang::InitializationKind const&amp;, llvm::MutableArrayRef&lt;clang::Expr*&gt;, clang::InitializationSequence::Step const&amp;, bool&amp;, bool, bool, clang::SourceLocation, clang::SourceLocation) SemaInit.cpp:0:0
#<!-- -->127 0x0000000006e138ba clang::InitializationSequence::Perform(clang::Sema&amp;, clang::InitializedEntity const&amp;, clang::InitializationKind const&amp;, llvm::MutableArrayRef&lt;clang::Expr*&gt;, clang::QualType*) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6e138ba)
#<!-- -->128 0x00000000069b8129 clang::Sema::AddInitializerToDecl(clang::Decl*, clang::Expr*, bool) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x69b8129)
#<!-- -->129 0x000000000663b78a clang::Parser::ParseDeclarationAfterDeclaratorAndAttributes(clang::Declarator&amp;, clang::Parser::ParsedTemplateInfo const&amp;, clang::Parser::ForRangeInit*) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x663b78a)
#<!-- -->130 0x000000000664a769 clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&amp;, clang::DeclaratorContext, clang::ParsedAttributes&amp;, clang::Parser::ParsedTemplateInfo&amp;, clang::SourceLocation*, clang::Parser::ForRangeInit*) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x664a769)
#<!-- -->131 0x0000000006653087 clang::Parser::ParseSimpleDeclaration(clang::DeclaratorContext, clang::SourceLocation&amp;, clang::ParsedAttributes&amp;, clang::ParsedAttributes&amp;, bool, clang::Parser::ForRangeInit*, clang::SourceLocation*) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6653087)
#<!-- -->132 0x0000000006653549 clang::Parser::ParseDeclaration(clang::DeclaratorContext, clang::SourceLocation&amp;, clang::ParsedAttributes&amp;, clang::ParsedAttributes&amp;, clang::SourceLocation*) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6653549)
#<!-- -->133 0x00000000066ff7c2 clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector&lt;clang::Stmt*, 32u&gt;&amp;, clang::Parser::ParsedStmtContext, clang::SourceLocation*, clang::ParsedAttributes&amp;, clang::ParsedAttributes&amp;) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x66ff7c2)
#<!-- -->134 0x00000000067004f0 clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector&lt;clang::Stmt*, 32u&gt;&amp;, clang::Parser::ParsedStmtContext, clang::SourceLocation*) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x67004f0)
#<!-- -->135 0x00000000067013c5 clang::Parser::ParseCompoundStatementBody(bool) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x67013c5)
#<!-- -->136 0x0000000006702b1a clang::Parser::ParseFunctionStatementBody(clang::Decl*, clang::Parser::ParseScope&amp;) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6702b1a)
#<!-- -->137 0x0000000006615923 clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&amp;, clang::Parser::ParsedTemplateInfo const&amp;, clang::Parser::LateParsedAttrList*) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6615923)
#<!-- -->138 0x000000000664b14d clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&amp;, clang::DeclaratorContext, clang::ParsedAttributes&amp;, clang::Parser::ParsedTemplateInfo&amp;, clang::SourceLocation*, clang::Parser::ForRangeInit*) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x664b14d)
#<!-- -->139 0x000000000660966e clang::Parser::ParseDeclOrFunctionDefInternal(clang::ParsedAttributes&amp;, clang::ParsedAttributes&amp;, clang::ParsingDeclSpec&amp;, clang::AccessSpecifier) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x660966e)
#<!-- -->140 0x0000000006609e2e clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributes&amp;, clang::ParsedAttributes&amp;, clang::ParsingDeclSpec*, clang::AccessSpecifier) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6609e2e)
#<!-- -->141 0x00000000066115c3 clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&amp;, clang::ParsedAttributes&amp;, clang::ParsingDeclSpec*) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x66115c3)
#<!-- -->142 0x00000000066124ad clang::Parser::ParseTopLevelDecl(clang::OpaquePtr&lt;clang::DeclGroupRef&gt;&amp;, clang::Sema::ModuleImportState&amp;) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x66124ad)
#<!-- -->143 0x00000000066049ca clang::ParseAST(clang::Sema&amp;, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x66049ca)
#<!-- -->144 0x000000000479ca99 clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x479ca99)
#<!-- -->145 0x000000000471b31e clang::CompilerInstance::ExecuteAction(clang::FrontendAction&amp;) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x471b31e)
#<!-- -->146 0x00000000048825be clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x48825be)
#<!-- -->147 0x0000000000cd452f cc1_main(llvm::ArrayRef&lt;char const*&gt;, char const*, void*) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0xcd452f)
#<!-- -->148 0x0000000000ccc23a ExecuteCC1Tool(llvm::SmallVectorImpl&lt;char const*&gt;&amp;, llvm::ToolContext const&amp;) driver.cpp:0:0
#<!-- -->149 0x0000000000cd0b7e clang_main(int, char**, llvm::ToolContext const&amp;) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0xcd0b7e)
#<!-- -->150 0x0000000000ba0c24 main (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0xba0c24)
#<!-- -->151 0x00007530a7a29d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#<!-- -->152 0x00007530a7a29e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#<!-- -->153 0x0000000000ccbcee _start (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0xccbcee)

@llvmbot
Copy link
Member

llvmbot commented Sep 29, 2024

@llvm/issue-subscribers-clang-modules

Author: None (Sirraide)

Given `a.ccm`: ```c++ module; #include <variant> #include <string> export module A;

export using Foo = std::variant<int, std::string, std::monostate>;
struct S {
Foo x = std::monostate{};
};


and `b.ccm`:
```c++
module;
#include &lt;variant&gt;
export module B;
import A;

void f() {
    Foo x;
    auto y = x;
}

Attempting to compile this asserts on trunk (https://godbolt.org/z/sqWax9eKq). I have not been able to reproduce this w/o modules (yet, but I’ll keep trying). #102353 seems to be the same assertion, but I’m not sure they’re related.

/root/llvm-project/clang/lib/Sema/SemaTemplateInstantiate.cpp:4439: 
llvm::PointerUnion&lt;clang::Decl*, llvm::SmallVector&lt;clang::VarDecl*, 4&gt;*&gt;* 
clang::LocalInstantiationScope::findInstantiationOf(const clang::Decl*): 
Assertion `isa&lt;LabelDecl&gt;(D) &amp;&amp; "declaration not instantiated in this scope"' failed.

Invocation:

/opt/compiler-explorer/clang-assertions-trunk/bin/clang++ --gcc-toolchain=/opt/compiler-explorer/gcc-snapshot   -fcolor-diagnostics -fno-crash-diagnostics -isystem/opt/compiler-explorer/libs/fmt/7.1.3/include -O2 -g -DNDEBUG -std=gnu++26 -MD -MT CMakeFiles/bug.dir/b.ccm.o -MF CMakeFiles/bug.dir/b.ccm.o.d @<!-- -->CMakeFiles/bug.dir/b.ccm.o.modmap -o CMakeFiles/bug.dir/b.ccm.o -c /app/b.ccm

It’s clearly crashing in b.ccm, but that might be due to a faulty module being emitted for a.ccm. I’m unfortunately not that familiar w/ our modules implementation, so I don’t know which one is more likely.

Stack trace:

Stack dump:
0.	Program arguments: /opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20 -cc1 -triple x86_64-unknown-linux-gnu -emit-module-interface -disable-free -clear-ast-before-backend -main-file-name b.ccm -mrelocation-model pic -pic-level 2 -pic-is-pie -mframe-pointer=none -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debug-info-kind=constructor -dwarf-version=5 -debugger-tuning=gdb -fdebug-compilation-dir=/app/build -fcoverage-compilation-dir=/app/build -resource-dir /opt/compiler-explorer/clang-assertions-trunk-20240928/lib/clang/20 -dependency-file CMakeFiles/bug.dir/b.ccm.o.d -MT CMakeFiles/bug.dir/b.ccm.o -sys-header-deps -module-file-deps -isystem /opt/compiler-explorer/libs/fmt/7.1.3/include -D NDEBUG -internal-isystem /opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/15.0.0/../../../../include/c++/15.0.0 -internal-isystem /opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/15.0.0/../../../../include/c++/15.0.0/x86_64-linux-gnu -internal-isystem /opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/15.0.0/../../../../include/c++/15.0.0/backward -internal-isystem /opt/compiler-explorer/clang-assertions-trunk-20240928/lib/clang/20/include -internal-isystem /usr/local/include -internal-isystem /opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/15.0.0/../../../../x86_64-linux-gnu/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -O2 -std=gnu++26 -fdeprecated-macro -ferror-limit 19 -fgnuc-version=4.2.1 -fno-implicit-modules -fmodule-file=A=CMakeFiles/bug.dir/A.pcm -fskip-odr-check-in-gmf -fcxx-exceptions -fexceptions -fcolor-diagnostics -vectorize-loops -vectorize-slp -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o CMakeFiles/bug.dir/B.pcm -x c++ /app/b.ccm
1.	/app/b.ccm:8:15: current parser token ';'
2.	/app/b.ccm:6:10: parsing function body 'f'
3.	/app/b.ccm:6:10: in compound statement ('{}')
4.	/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/15.0.0/../../../../include/c++/15.0.0/variant:582:7: instantiating function definition 'std::__detail::__variant::_Copy_ctor_base&lt;false, int, std::basic_string&lt;char&gt;, std::monostate&gt;::_Copy_ctor_base'
5.	/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/15.0.0/../../../../include/c++/15.0.0/variant:185:5: instantiating function definition 'std::__detail::__variant::__raw_idx_visit&lt;(lambda at /opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/15.0.0/../../../../include/c++/15.0.0/variant:586:4), const std::variant&lt;int, std::basic_string&lt;char&gt;, std::monostate&gt; &amp;&gt;'
6.	/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/15.0.0/../../../../include/c++/15.0.0/variant:1844:5: instantiating function definition 'std::__do_visit&lt;std::__detail::__variant::__variant_idx_cookie, (lambda at /opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/15.0.0/../../../../include/c++/15.0.0/variant:586:4), const std::variant&lt;int, std::basic_string&lt;char&gt;, std::monostate&gt; &amp;&gt;'
  #<!-- -->0 0x0000000003b8cab8 llvm::sys::PrintStackTrace(llvm::raw_ostream&amp;, int) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x3b8cab8)
  #<!-- -->1 0x0000000003b8a46c SignalHandler(int) Signals.cpp:0:0
  #<!-- -->2 0x00007530a7a42520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
  #<!-- -->3 0x00007530a7a969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
  #<!-- -->4 0x00007530a7a42476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
  #<!-- -->5 0x00007530a7a287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
  #<!-- -->6 0x00007530a7a2871b (/lib/x86_64-linux-gnu/libc.so.6+0x2871b)
  #<!-- -->7 0x00007530a7a39e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
  #<!-- -->8 0x00000000072eac9e clang::LocalInstantiationScope::findInstantiationOf(clang::Decl const*) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x72eac9e)
  #<!-- -->9 0x00000000073a81a7 clang::Sema::FindInstantiatedDecl(clang::SourceLocation, clang::NamedDecl*, clang::MultiLevelTemplateArgumentList const&amp;, bool) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x73a81a7)
 #<!-- -->10 0x00000000072d75c1 (anonymous namespace)::TemplateInstantiator::TransformDecl(clang::SourceLocation, clang::Decl*) SemaTemplateInstantiate.cpp:0:0
 #<!-- -->11 0x000000000730bf58 clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::TransformType(clang::TypeLocBuilder&amp;, clang::TypeLoc) SemaTemplateInstantiate.cpp:0:0
 #<!-- -->12 0x000000000732c654 clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::TransformElaboratedType(clang::TypeLocBuilder&amp;, clang::ElaboratedTypeLoc) SemaTemplateInstantiate.cpp:0:0
 #<!-- -->13 0x000000000730b643 clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::TransformType(clang::TypeLocBuilder&amp;, clang::TypeLoc) SemaTemplateInstantiate.cpp:0:0
 #<!-- -->14 0x00000000073116bd clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::TransformReferenceType(clang::TypeLocBuilder&amp;, clang::ReferenceTypeLoc) SemaTemplateInstantiate.cpp:0:0
 #<!-- -->15 0x000000000730bbfc clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::TransformType(clang::TypeLocBuilder&amp;, clang::TypeLoc) SemaTemplateInstantiate.cpp:0:0
 #<!-- -->16 0x0000000007311e0a clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::TransformType(clang::TypeSourceInfo*) SemaTemplateInstantiate.cpp:0:0
 #<!-- -->17 0x00000000073207f6 clang::Sema::SubstType(clang::TypeSourceInfo*, clang::MultiLevelTemplateArgumentList const&amp;, clang::SourceLocation, clang::DeclarationName, bool) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x73207f6)
 #<!-- -->18 0x000000000732f345 clang::Sema::SubstParmVarDecl(clang::ParmVarDecl*, clang::MultiLevelTemplateArgumentList const&amp;, int, std::optional&lt;unsigned int&gt;, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x732f345)
 #<!-- -->19 0x00000000073309e0 clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::TransformFunctionTypeParams(clang::SourceLocation, llvm::ArrayRef&lt;clang::ParmVarDecl*&gt;, clang::QualType const*, clang::FunctionType::ExtParameterInfo const*, llvm::SmallVectorImpl&lt;clang::QualType&gt;&amp;, llvm::SmallVectorImpl&lt;clang::ParmVarDecl*&gt;*, clang::Sema::ExtParameterInfoBuilder&amp;, unsigned int*) SemaTemplateInstantiate.cpp:0:0
 #<!-- -->20 0x000000000730a22f clang::QualType clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::TransformFunctionProtoType&lt;clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::TransformFunctionProtoType(clang::TypeLocBuilder&amp;, clang::FunctionProtoTypeLoc)::'lambda'(clang::FunctionProtoType::ExceptionSpecInfo&amp;, bool&amp;)&gt;(clang::TypeLocBuilder&amp;, clang::FunctionProtoTypeLoc, clang::CXXRecordDecl*, clang::Qualifiers, clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::TransformFunctionProtoType(clang::TypeLocBuilder&amp;, clang::FunctionProtoTypeLoc)::'lambda'(clang::FunctionProtoType::ExceptionSpecInfo&amp;, bool&amp;)) (.constprop.0) SemaTemplateInstantiate.cpp:0:0
 #<!-- -->21 0x000000000730b7b4 clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::TransformType(clang::TypeLocBuilder&amp;, clang::TypeLoc) SemaTemplateInstantiate.cpp:0:0
 #<!-- -->22 0x00000000072f8a51 clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::TransformLambdaExpr(clang::LambdaExpr*) SemaTemplateInstantiate.cpp:0:0
 #<!-- -->23 0x00000000072fa7cd clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::TransformExpr(clang::Expr*) SemaTemplateInstantiate.cpp:0:0
 #<!-- -->24 0x00000000073069ee clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::TransformCallExpr(clang::CallExpr*) SemaTemplateInstantiate.cpp:0:0
 #<!-- -->25 0x00000000072fa327 clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::TransformExpr(clang::Expr*) SemaTemplateInstantiate.cpp:0:0
 #<!-- -->26 0x00000000072fc058 clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::TransformInitializer(clang::Expr*, bool) (.part.0) SemaTemplateInstantiate.cpp:0:0
 #<!-- -->27 0x00000000072fc67b clang::Sema::SubstInitializer(clang::Expr*, clang::MultiLevelTemplateArgumentList const&amp;, bool) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x72fc67b)
 #<!-- -->28 0x00000000073647d6 clang::Sema::InstantiateVariableInitializer(clang::VarDecl*, clang::VarDecl*, clang::MultiLevelTemplateArgumentList const&amp;) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x73647d6)
 #<!-- -->29 0x00000000073ab910 clang::Sema::BuildVariableInstantiation(clang::VarDecl*, clang::VarDecl*, clang::MultiLevelTemplateArgumentList const&amp;, llvm::SmallVector&lt;clang::Sema::LateInstantiatedAttribute, 16u&gt;*, clang::DeclContext*, clang::LocalInstantiationScope*, bool, clang::VarTemplateSpecializationDecl*) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x73ab910)
 #<!-- -->30 0x00000000073b5e17 clang::TemplateDeclInstantiator::VisitVarDecl(clang::VarDecl*, bool, llvm::ArrayRef&lt;clang::BindingDecl*&gt;*) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x73b5e17)
 #<!-- -->31 0x00000000073baf44 void llvm::function_ref&lt;void ()&gt;::callback_fn&lt;clang::Sema::SubstDecl(clang::Decl*, clang::DeclContext*, clang::MultiLevelTemplateArgumentList const&amp;)::'lambda'()&gt;(long) SemaTemplateInstantiateDecl.cpp:0:0
 #<!-- -->32 0x000000000677ac21 clang::Sema::runWithSufficientStackSpace(clang::SourceLocation, llvm::function_ref&lt;void ()&gt;) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x677ac21)
 #<!-- -->33 0x00000000073626ba clang::Sema::SubstDecl(clang::Decl*, clang::DeclContext*, clang::MultiLevelTemplateArgumentList const&amp;) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x73626ba)
 #<!-- -->34 0x00000000072eba15 clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::TransformDeclStmt(clang::DeclStmt*) SemaTemplateInstantiate.cpp:0:0
 #<!-- -->35 0x0000000007339ec4 clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::TransformCompoundStmt(clang::CompoundStmt*, bool) SemaTemplateInstantiate.cpp:0:0
 #<!-- -->36 0x000000000733fe97 clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::TransformIfStmt(clang::IfStmt*) SemaTemplateInstantiate.cpp:0:0
 #<!-- -->37 0x0000000007339ec4 clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::TransformCompoundStmt(clang::CompoundStmt*, bool) SemaTemplateInstantiate.cpp:0:0
 #<!-- -->38 0x000000000733fe97 clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::TransformIfStmt(clang::IfStmt*) SemaTemplateInstantiate.cpp:0:0
 #<!-- -->39 0x0000000007339ec4 clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::TransformCompoundStmt(clang::CompoundStmt*, bool) SemaTemplateInstantiate.cpp:0:0
 #<!-- -->40 0x0000000007341964 clang::Sema::SubstStmt(clang::Stmt*, clang::MultiLevelTemplateArgumentList const&amp;) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x7341964)
 #<!-- -->41 0x00000000073af5d9 clang::Sema::InstantiateFunctionDefinition(clang::SourceLocation, clang::FunctionDecl*, bool, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x73af5d9)
 #<!-- -->42 0x000000000677ac21 clang::Sema::runWithSufficientStackSpace(clang::SourceLocation, llvm::function_ref&lt;void ()&gt;) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x677ac21)
 #<!-- -->43 0x00000000071e24e2 clang::Sema::DeduceReturnType(clang::FunctionDecl*, clang::SourceLocation, bool) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x71e24e2)
 #<!-- -->44 0x0000000006b9e4a5 clang::Sema::DiagnoseUseOfDecl(clang::NamedDecl*, llvm::ArrayRef&lt;clang::SourceLocation&gt;, clang::ObjCInterfaceDecl const*, bool, bool, clang::ObjCInterfaceDecl*, bool) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6b9e4a5)
 #<!-- -->45 0x0000000007061844 FinishOverloadedCallExpr(clang::Sema&amp;, clang::Scope*, clang::Expr*, clang::UnresolvedLookupExpr*, clang::SourceLocation, llvm::MutableArrayRef&lt;clang::Expr*&gt;, clang::SourceLocation, clang::Expr*, clang::OverloadCandidateSet*, clang::OverloadCandidate**, clang::OverloadingResult, bool) SemaOverload.cpp:0:0
 #<!-- -->46 0x00000000070626f4 clang::Sema::BuildOverloadedCallExpr(clang::Scope*, clang::Expr*, clang::UnresolvedLookupExpr*, clang::SourceLocation, llvm::MutableArrayRef&lt;clang::Expr*&gt;, clang::SourceLocation, clang::Expr*, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x70626f4)
 #<!-- -->47 0x0000000006c159a8 clang::Sema::BuildCallExpr(clang::Scope*, clang::Expr*, clang::SourceLocation, llvm::MutableArrayRef&lt;clang::Expr*&gt;, clang::SourceLocation, clang::Expr*, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6c159a8)
 #<!-- -->48 0x0000000006c17f0c clang::Sema::ActOnCallExpr(clang::Scope*, clang::Expr*, clang::SourceLocation, llvm::MutableArrayRef&lt;clang::Expr*&gt;, clang::SourceLocation, clang::Expr*) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6c17f0c)
 #<!-- -->49 0x0000000007306ac1 clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::TransformCallExpr(clang::CallExpr*) SemaTemplateInstantiate.cpp:0:0
 #<!-- -->50 0x00000000072fa327 clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::TransformExpr(clang::Expr*) SemaTemplateInstantiate.cpp:0:0
 #<!-- -->51 0x00000000073396ff clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::TransformStmt(clang::Stmt*, clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::StmtDiscardKind) SemaTemplateInstantiate.cpp:0:0
 #<!-- -->52 0x0000000007339ec4 clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::TransformCompoundStmt(clang::CompoundStmt*, bool) SemaTemplateInstantiate.cpp:0:0
 #<!-- -->53 0x0000000007341964 clang::Sema::SubstStmt(clang::Stmt*, clang::MultiLevelTemplateArgumentList const&amp;) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x7341964)
 #<!-- -->54 0x00000000073af5d9 clang::Sema::InstantiateFunctionDefinition(clang::SourceLocation, clang::FunctionDecl*, bool, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x73af5d9)
 #<!-- -->55 0x0000000006bf3399 void llvm::function_ref&lt;void ()&gt;::callback_fn&lt;clang::Sema::MarkFunctionReferenced(clang::SourceLocation, clang::FunctionDecl*, bool)::'lambda'()&gt;(long) SemaExpr.cpp:0:0
 #<!-- -->56 0x000000000677ac21 clang::Sema::runWithSufficientStackSpace(clang::SourceLocation, llvm::function_ref&lt;void ()&gt;) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x677ac21)
 #<!-- -->57 0x0000000006be793f clang::Sema::MarkFunctionReferenced(clang::SourceLocation, clang::FunctionDecl*, bool) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6be793f)
 #<!-- -->58 0x0000000006be7fcd MarkExprReferenced(clang::Sema&amp;, clang::SourceLocation, clang::Decl*, clang::Expr*, bool, llvm::DenseMap&lt;clang::VarDecl const*, int, llvm::DenseMapInfo&lt;clang::VarDecl const*, void&gt;, llvm::detail::DenseMapPair&lt;clang::VarDecl const*, int&gt;&gt;&amp;) SemaExpr.cpp:0:0
 #<!-- -->59 0x0000000006be8619 clang::Sema::BuildDeclRefExpr(clang::ValueDecl*, clang::QualType, clang::ExprValueKind, clang::DeclarationNameInfo const&amp;, clang::NestedNameSpecifierLoc, clang::NamedDecl*, clang::SourceLocation, clang::TemplateArgumentListInfo const*) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6be8619)
 #<!-- -->60 0x000000000702e36b clang::Sema::FixOverloadedFunctionReference(clang::Expr*, clang::DeclAccessPair, clang::FunctionDecl*) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x702e36b)
 #<!-- -->61 0x000000000706158e FinishOverloadedCallExpr(clang::Sema&amp;, clang::Scope*, clang::Expr*, clang::UnresolvedLookupExpr*, clang::SourceLocation, llvm::MutableArrayRef&lt;clang::Expr*&gt;, clang::SourceLocation, clang::Expr*, clang::OverloadCandidateSet*, clang::OverloadCandidate**, clang::OverloadingResult, bool) SemaOverload.cpp:0:0
 #<!-- -->62 0x00000000070626f4 clang::Sema::BuildOverloadedCallExpr(clang::Scope*, clang::Expr*, clang::UnresolvedLookupExpr*, clang::SourceLocation, llvm::MutableArrayRef&lt;clang::Expr*&gt;, clang::SourceLocation, clang::Expr*, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x70626f4)
 #<!-- -->63 0x0000000006c159a8 clang::Sema::BuildCallExpr(clang::Scope*, clang::Expr*, clang::SourceLocation, llvm::MutableArrayRef&lt;clang::Expr*&gt;, clang::SourceLocation, clang::Expr*, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6c159a8)
 #<!-- -->64 0x0000000006c17f0c clang::Sema::ActOnCallExpr(clang::Scope*, clang::Expr*, clang::SourceLocation, llvm::MutableArrayRef&lt;clang::Expr*&gt;, clang::SourceLocation, clang::Expr*) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6c17f0c)
 #<!-- -->65 0x0000000007306ac1 clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::TransformCallExpr(clang::CallExpr*) SemaTemplateInstantiate.cpp:0:0
 #<!-- -->66 0x00000000072fa327 clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::TransformExpr(clang::Expr*) SemaTemplateInstantiate.cpp:0:0
 #<!-- -->67 0x00000000073396ff clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::TransformStmt(clang::Stmt*, clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::StmtDiscardKind) SemaTemplateInstantiate.cpp:0:0
 #<!-- -->68 0x0000000007339ec4 clang::TreeTransform&lt;(anonymous namespace)::TemplateInstantiator&gt;::TransformCompoundStmt(clang::CompoundStmt*, bool) SemaTemplateInstantiate.cpp:0:0
 #<!-- -->69 0x0000000007341964 clang::Sema::SubstStmt(clang::Stmt*, clang::MultiLevelTemplateArgumentList const&amp;) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x7341964)
 #<!-- -->70 0x00000000073af5d9 clang::Sema::InstantiateFunctionDefinition(clang::SourceLocation, clang::FunctionDecl*, bool, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x73af5d9)
 #<!-- -->71 0x0000000006bf3399 void llvm::function_ref&lt;void ()&gt;::callback_fn&lt;clang::Sema::MarkFunctionReferenced(clang::SourceLocation, clang::FunctionDecl*, bool)::'lambda'()&gt;(long) SemaExpr.cpp:0:0
 #<!-- -->72 0x000000000677ac21 clang::Sema::runWithSufficientStackSpace(clang::SourceLocation, llvm::function_ref&lt;void ()&gt;) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x677ac21)
 #<!-- -->73 0x0000000006be793f clang::Sema::MarkFunctionReferenced(clang::SourceLocation, clang::FunctionDecl*, bool) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6be793f)
 #<!-- -->74 0x0000000006a4c89c clang::Sema::BuildCXXConstructExpr(clang::SourceLocation, clang::QualType, clang::CXXConstructorDecl*, bool, llvm::MutableArrayRef&lt;clang::Expr*&gt;, bool, bool, bool, bool, clang::CXXConstructionKind, clang::SourceRange) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6a4c89c)
 #<!-- -->75 0x0000000006aeb154 clang::Sema::BuildCXXConstructExpr(clang::SourceLocation, clang::QualType, clang::NamedDecl*, clang::CXXConstructorDecl*, llvm::MutableArrayRef&lt;clang::Expr*&gt;, bool, bool, bool, bool, clang::CXXConstructionKind, clang::SourceRange) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6aeb154)
 #<!-- -->76 0x0000000006e045cd PerformConstructorInitialization(clang::Sema&amp;, clang::InitializedEntity const&amp;, clang::InitializationKind const&amp;, llvm::MutableArrayRef&lt;clang::Expr*&gt;, clang::InitializationSequence::Step const&amp;, bool&amp;, bool, bool, clang::SourceLocation, clang::SourceLocation) SemaInit.cpp:0:0
 #<!-- -->77 0x0000000006e138ba clang::InitializationSequence::Perform(clang::Sema&amp;, clang::InitializedEntity const&amp;, clang::InitializationKind const&amp;, llvm::MutableArrayRef&lt;clang::Expr*&gt;, clang::QualType*) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6e138ba)
 #<!-- -->78 0x0000000006a520af BuildImplicitBaseInitializer(clang::Sema&amp;, clang::CXXConstructorDecl*, ImplicitInitializerKind, clang::CXXBaseSpecifier*, bool, clang::CXXCtorInitializer*&amp;) SemaDeclCXX.cpp:0:0
 #<!-- -->79 0x0000000006a99ad5 clang::Sema::SetCtorInitializers(clang::CXXConstructorDecl*, bool, llvm::ArrayRef&lt;clang::CXXCtorInitializer*&gt;) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6a99ad5)
 #<!-- -->80 0x0000000006aef60c clang::Sema::DefineImplicitCopyConstructor(clang::SourceLocation, clang::CXXConstructorDecl*) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6aef60c)
 #<!-- -->81 0x0000000006bf375b void llvm::function_ref&lt;void ()&gt;::callback_fn&lt;clang::Sema::MarkFunctionReferenced(clang::SourceLocation, clang::FunctionDecl*, bool)::'lambda'()&gt;(long) SemaExpr.cpp:0:0
 #<!-- -->82 0x000000000677ac21 clang::Sema::runWithSufficientStackSpace(clang::SourceLocation, llvm::function_ref&lt;void ()&gt;) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x677ac21)
 #<!-- -->83 0x0000000006be793f clang::Sema::MarkFunctionReferenced(clang::SourceLocation, clang::FunctionDecl*, bool) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6be793f)
 #<!-- -->84 0x0000000006a4c89c clang::Sema::BuildCXXConstructExpr(clang::SourceLocation, clang::QualType, clang::CXXConstructorDecl*, bool, llvm::MutableArrayRef&lt;clang::Expr*&gt;, bool, bool, bool, bool, clang::CXXConstructionKind, clang::SourceRange) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6a4c89c)
 #<!-- -->85 0x0000000006aeb154 clang::Sema::BuildCXXConstructExpr(clang::SourceLocation, clang::QualType, clang::NamedDecl*, clang::CXXConstructorDecl*, llvm::MutableArrayRef&lt;clang::Expr*&gt;, bool, bool, bool, bool, clang::CXXConstructionKind, clang::SourceRange) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6aeb154)
 #<!-- -->86 0x0000000006e045cd PerformConstructorInitialization(clang::Sema&amp;, clang::InitializedEntity const&amp;, clang::InitializationKind const&amp;, llvm::MutableArrayRef&lt;clang::Expr*&gt;, clang::InitializationSequence::Step const&amp;, bool&amp;, bool, bool, clang::SourceLocation, clang::SourceLocation) SemaInit.cpp:0:0
 #<!-- -->87 0x0000000006e138ba clang::InitializationSequence::Perform(clang::Sema&amp;, clang::InitializedEntity const&amp;, clang::InitializationKind const&amp;, llvm::MutableArrayRef&lt;clang::Expr*&gt;, clang::QualType*) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6e138ba)
 #<!-- -->88 0x0000000006a520af BuildImplicitBaseInitializer(clang::Sema&amp;, clang::CXXConstructorDecl*, ImplicitInitializerKind, clang::CXXBaseSpecifier*, bool, clang::CXXCtorInitializer*&amp;) SemaDeclCXX.cpp:0:0
 #<!-- -->89 0x0000000006a99ad5 clang::Sema::SetCtorInitializers(clang::CXXConstructorDecl*, bool, llvm::ArrayRef&lt;clang::CXXCtorInitializer*&gt;) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6a99ad5)
 #<!-- -->90 0x0000000006aef60c clang::Sema::DefineImplicitCopyConstructor(clang::SourceLocation, clang::CXXConstructorDecl*) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6aef60c)
 #<!-- -->91 0x0000000006bf375b void llvm::function_ref&lt;void ()&gt;::callback_fn&lt;clang::Sema::MarkFunctionReferenced(clang::SourceLocation, clang::FunctionDecl*, bool)::'lambda'()&gt;(long) SemaExpr.cpp:0:0
 #<!-- -->92 0x000000000677ac21 clang::Sema::runWithSufficientStackSpace(clang::SourceLocation, llvm::function_ref&lt;void ()&gt;) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x677ac21)
 #<!-- -->93 0x0000000006be793f clang::Sema::MarkFunctionReferenced(clang::SourceLocation, clang::FunctionDecl*, bool) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6be793f)
 #<!-- -->94 0x0000000006a4c89c clang::Sema::BuildCXXConstructExpr(clang::SourceLocation, clang::QualType, clang::CXXConstructorDecl*, bool, llvm::MutableArrayRef&lt;clang::Expr*&gt;, bool, bool, bool, bool, clang::CXXConstructionKind, clang::SourceRange) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6a4c89c)
 #<!-- -->95 0x0000000006aeb154 clang::Sema::BuildCXXConstructExpr(clang::SourceLocation, clang::QualType, clang::NamedDecl*, clang::CXXConstructorDecl*, llvm::MutableArrayRef&lt;clang::Expr*&gt;, bool, bool, bool, bool, clang::CXXConstructionKind, clang::SourceRange) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6aeb154)
 #<!-- -->96 0x0000000006e045cd PerformConstructorInitialization(clang::Sema&amp;, clang::InitializedEntity const&amp;, clang::InitializationKind const&amp;, llvm::MutableArrayRef&lt;clang::Expr*&gt;, clang::InitializationSequence::Step const&amp;, bool&amp;, bool, bool, clang::SourceLocation, clang::SourceLocation) SemaInit.cpp:0:0
 #<!-- -->97 0x0000000006e138ba clang::InitializationSequence::Perform(clang::Sema&amp;, clang::InitializedEntity const&amp;, clang::InitializationKind const&amp;, llvm::MutableArrayRef&lt;clang::Expr*&gt;, clang::QualType*) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6e138ba)
 #<!-- -->98 0x0000000006a520af BuildImplicitBaseInitializer(clang::Sema&amp;, clang::CXXConstructorDecl*, ImplicitInitializerKind, clang::CXXBaseSpecifier*, bool, clang::CXXCtorInitializer*&amp;) SemaDeclCXX.cpp:0:0
 #<!-- -->99 0x0000000006a99ad5 clang::Sema::SetCtorInitializers(clang::CXXConstructorDecl*, bool, llvm::ArrayRef&lt;clang::CXXCtorInitializer*&gt;) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6a99ad5)
#<!-- -->100 0x0000000006aef60c clang::Sema::DefineImplicitCopyConstructor(clang::SourceLocation, clang::CXXConstructorDecl*) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6aef60c)
#<!-- -->101 0x0000000006bf375b void llvm::function_ref&lt;void ()&gt;::callback_fn&lt;clang::Sema::MarkFunctionReferenced(clang::SourceLocation, clang::FunctionDecl*, bool)::'lambda'()&gt;(long) SemaExpr.cpp:0:0
#<!-- -->102 0x000000000677ac21 clang::Sema::runWithSufficientStackSpace(clang::SourceLocation, llvm::function_ref&lt;void ()&gt;) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x677ac21)
#<!-- -->103 0x0000000006be793f clang::Sema::MarkFunctionReferenced(clang::SourceLocation, clang::FunctionDecl*, bool) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6be793f)
#<!-- -->104 0x0000000006a4c89c clang::Sema::BuildCXXConstructExpr(clang::SourceLocation, clang::QualType, clang::CXXConstructorDecl*, bool, llvm::MutableArrayRef&lt;clang::Expr*&gt;, bool, bool, bool, bool, clang::CXXConstructionKind, clang::SourceRange) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6a4c89c)
#<!-- -->105 0x0000000006aeb154 clang::Sema::BuildCXXConstructExpr(clang::SourceLocation, clang::QualType, clang::NamedDecl*, clang::CXXConstructorDecl*, llvm::MutableArrayRef&lt;clang::Expr*&gt;, bool, bool, bool, bool, clang::CXXConstructionKind, clang::SourceRange) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6aeb154)
#<!-- -->106 0x0000000006e045cd PerformConstructorInitialization(clang::Sema&amp;, clang::InitializedEntity const&amp;, clang::InitializationKind const&amp;, llvm::MutableArrayRef&lt;clang::Expr*&gt;, clang::InitializationSequence::Step const&amp;, bool&amp;, bool, bool, clang::SourceLocation, clang::SourceLocation) SemaInit.cpp:0:0
#<!-- -->107 0x0000000006e138ba clang::InitializationSequence::Perform(clang::Sema&amp;, clang::InitializedEntity const&amp;, clang::InitializationKind const&amp;, llvm::MutableArrayRef&lt;clang::Expr*&gt;, clang::QualType*) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6e138ba)
#<!-- -->108 0x0000000006a520af BuildImplicitBaseInitializer(clang::Sema&amp;, clang::CXXConstructorDecl*, ImplicitInitializerKind, clang::CXXBaseSpecifier*, bool, clang::CXXCtorInitializer*&amp;) SemaDeclCXX.cpp:0:0
#<!-- -->109 0x0000000006a99ad5 clang::Sema::SetCtorInitializers(clang::CXXConstructorDecl*, bool, llvm::ArrayRef&lt;clang::CXXCtorInitializer*&gt;) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6a99ad5)
#<!-- -->110 0x0000000006aef60c clang::Sema::DefineImplicitCopyConstructor(clang::SourceLocation, clang::CXXConstructorDecl*) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6aef60c)
#<!-- -->111 0x0000000006bf375b void llvm::function_ref&lt;void ()&gt;::callback_fn&lt;clang::Sema::MarkFunctionReferenced(clang::SourceLocation, clang::FunctionDecl*, bool)::'lambda'()&gt;(long) SemaExpr.cpp:0:0
#<!-- -->112 0x000000000677ac21 clang::Sema::runWithSufficientStackSpace(clang::SourceLocation, llvm::function_ref&lt;void ()&gt;) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x677ac21)
#<!-- -->113 0x0000000006be793f clang::Sema::MarkFunctionReferenced(clang::SourceLocation, clang::FunctionDecl*, bool) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6be793f)
#<!-- -->114 0x0000000006a4c89c clang::Sema::BuildCXXConstructExpr(clang::SourceLocation, clang::QualType, clang::CXXConstructorDecl*, bool, llvm::MutableArrayRef&lt;clang::Expr*&gt;, bool, bool, bool, bool, clang::CXXConstructionKind, clang::SourceRange) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6a4c89c)
#<!-- -->115 0x0000000006aeb154 clang::Sema::BuildCXXConstructExpr(clang::SourceLocation, clang::QualType, clang::NamedDecl*, clang::CXXConstructorDecl*, llvm::MutableArrayRef&lt;clang::Expr*&gt;, bool, bool, bool, bool, clang::CXXConstructionKind, clang::SourceRange) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6aeb154)
#<!-- -->116 0x0000000006e045cd PerformConstructorInitialization(clang::Sema&amp;, clang::InitializedEntity const&amp;, clang::InitializationKind const&amp;, llvm::MutableArrayRef&lt;clang::Expr*&gt;, clang::InitializationSequence::Step const&amp;, bool&amp;, bool, bool, clang::SourceLocation, clang::SourceLocation) SemaInit.cpp:0:0
#<!-- -->117 0x0000000006e138ba clang::InitializationSequence::Perform(clang::Sema&amp;, clang::InitializedEntity const&amp;, clang::InitializationKind const&amp;, llvm::MutableArrayRef&lt;clang::Expr*&gt;, clang::QualType*) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6e138ba)
#<!-- -->118 0x0000000006a520af BuildImplicitBaseInitializer(clang::Sema&amp;, clang::CXXConstructorDecl*, ImplicitInitializerKind, clang::CXXBaseSpecifier*, bool, clang::CXXCtorInitializer*&amp;) SemaDeclCXX.cpp:0:0
#<!-- -->119 0x0000000006a99ad5 clang::Sema::SetCtorInitializers(clang::CXXConstructorDecl*, bool, llvm::ArrayRef&lt;clang::CXXCtorInitializer*&gt;) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6a99ad5)
#<!-- -->120 0x0000000006aef60c clang::Sema::DefineImplicitCopyConstructor(clang::SourceLocation, clang::CXXConstructorDecl*) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6aef60c)
#<!-- -->121 0x0000000006bf375b void llvm::function_ref&lt;void ()&gt;::callback_fn&lt;clang::Sema::MarkFunctionReferenced(clang::SourceLocation, clang::FunctionDecl*, bool)::'lambda'()&gt;(long) SemaExpr.cpp:0:0
#<!-- -->122 0x000000000677ac21 clang::Sema::runWithSufficientStackSpace(clang::SourceLocation, llvm::function_ref&lt;void ()&gt;) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x677ac21)
#<!-- -->123 0x0000000006be793f clang::Sema::MarkFunctionReferenced(clang::SourceLocation, clang::FunctionDecl*, bool) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6be793f)
#<!-- -->124 0x0000000006a4c89c clang::Sema::BuildCXXConstructExpr(clang::SourceLocation, clang::QualType, clang::CXXConstructorDecl*, bool, llvm::MutableArrayRef&lt;clang::Expr*&gt;, bool, bool, bool, bool, clang::CXXConstructionKind, clang::SourceRange) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6a4c89c)
#<!-- -->125 0x0000000006aeb154 clang::Sema::BuildCXXConstructExpr(clang::SourceLocation, clang::QualType, clang::NamedDecl*, clang::CXXConstructorDecl*, llvm::MutableArrayRef&lt;clang::Expr*&gt;, bool, bool, bool, bool, clang::CXXConstructionKind, clang::SourceRange) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6aeb154)
#<!-- -->126 0x0000000006e045cd PerformConstructorInitialization(clang::Sema&amp;, clang::InitializedEntity const&amp;, clang::InitializationKind const&amp;, llvm::MutableArrayRef&lt;clang::Expr*&gt;, clang::InitializationSequence::Step const&amp;, bool&amp;, bool, bool, clang::SourceLocation, clang::SourceLocation) SemaInit.cpp:0:0
#<!-- -->127 0x0000000006e138ba clang::InitializationSequence::Perform(clang::Sema&amp;, clang::InitializedEntity const&amp;, clang::InitializationKind const&amp;, llvm::MutableArrayRef&lt;clang::Expr*&gt;, clang::QualType*) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6e138ba)
#<!-- -->128 0x00000000069b8129 clang::Sema::AddInitializerToDecl(clang::Decl*, clang::Expr*, bool) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x69b8129)
#<!-- -->129 0x000000000663b78a clang::Parser::ParseDeclarationAfterDeclaratorAndAttributes(clang::Declarator&amp;, clang::Parser::ParsedTemplateInfo const&amp;, clang::Parser::ForRangeInit*) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x663b78a)
#<!-- -->130 0x000000000664a769 clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&amp;, clang::DeclaratorContext, clang::ParsedAttributes&amp;, clang::Parser::ParsedTemplateInfo&amp;, clang::SourceLocation*, clang::Parser::ForRangeInit*) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x664a769)
#<!-- -->131 0x0000000006653087 clang::Parser::ParseSimpleDeclaration(clang::DeclaratorContext, clang::SourceLocation&amp;, clang::ParsedAttributes&amp;, clang::ParsedAttributes&amp;, bool, clang::Parser::ForRangeInit*, clang::SourceLocation*) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6653087)
#<!-- -->132 0x0000000006653549 clang::Parser::ParseDeclaration(clang::DeclaratorContext, clang::SourceLocation&amp;, clang::ParsedAttributes&amp;, clang::ParsedAttributes&amp;, clang::SourceLocation*) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6653549)
#<!-- -->133 0x00000000066ff7c2 clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector&lt;clang::Stmt*, 32u&gt;&amp;, clang::Parser::ParsedStmtContext, clang::SourceLocation*, clang::ParsedAttributes&amp;, clang::ParsedAttributes&amp;) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x66ff7c2)
#<!-- -->134 0x00000000067004f0 clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector&lt;clang::Stmt*, 32u&gt;&amp;, clang::Parser::ParsedStmtContext, clang::SourceLocation*) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x67004f0)
#<!-- -->135 0x00000000067013c5 clang::Parser::ParseCompoundStatementBody(bool) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x67013c5)
#<!-- -->136 0x0000000006702b1a clang::Parser::ParseFunctionStatementBody(clang::Decl*, clang::Parser::ParseScope&amp;) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6702b1a)
#<!-- -->137 0x0000000006615923 clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&amp;, clang::Parser::ParsedTemplateInfo const&amp;, clang::Parser::LateParsedAttrList*) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6615923)
#<!-- -->138 0x000000000664b14d clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&amp;, clang::DeclaratorContext, clang::ParsedAttributes&amp;, clang::Parser::ParsedTemplateInfo&amp;, clang::SourceLocation*, clang::Parser::ForRangeInit*) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x664b14d)
#<!-- -->139 0x000000000660966e clang::Parser::ParseDeclOrFunctionDefInternal(clang::ParsedAttributes&amp;, clang::ParsedAttributes&amp;, clang::ParsingDeclSpec&amp;, clang::AccessSpecifier) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x660966e)
#<!-- -->140 0x0000000006609e2e clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributes&amp;, clang::ParsedAttributes&amp;, clang::ParsingDeclSpec*, clang::AccessSpecifier) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x6609e2e)
#<!-- -->141 0x00000000066115c3 clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&amp;, clang::ParsedAttributes&amp;, clang::ParsingDeclSpec*) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x66115c3)
#<!-- -->142 0x00000000066124ad clang::Parser::ParseTopLevelDecl(clang::OpaquePtr&lt;clang::DeclGroupRef&gt;&amp;, clang::Sema::ModuleImportState&amp;) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x66124ad)
#<!-- -->143 0x00000000066049ca clang::ParseAST(clang::Sema&amp;, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x66049ca)
#<!-- -->144 0x000000000479ca99 clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x479ca99)
#<!-- -->145 0x000000000471b31e clang::CompilerInstance::ExecuteAction(clang::FrontendAction&amp;) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x471b31e)
#<!-- -->146 0x00000000048825be clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0x48825be)
#<!-- -->147 0x0000000000cd452f cc1_main(llvm::ArrayRef&lt;char const*&gt;, char const*, void*) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0xcd452f)
#<!-- -->148 0x0000000000ccc23a ExecuteCC1Tool(llvm::SmallVectorImpl&lt;char const*&gt;&amp;, llvm::ToolContext const&amp;) driver.cpp:0:0
#<!-- -->149 0x0000000000cd0b7e clang_main(int, char**, llvm::ToolContext const&amp;) (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0xcd0b7e)
#<!-- -->150 0x0000000000ba0c24 main (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0xba0c24)
#<!-- -->151 0x00007530a7a29d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#<!-- -->152 0x00007530a7a29e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#<!-- -->153 0x0000000000ccbcee _start (/opt/compiler-explorer/clang-assertions-trunk-20240928/bin/clang-20+0xccbcee)

@Sirraide Sirraide changed the title [Clang] [Modules] Crash on code involving variants [Clang] [Modules] Assertion declaration not instantiated in this scope in code involving variants and modules Sep 29, 2024
@ghost

This comment was marked as spam.

@ChuanqiXu9
Copy link
Member

This might help:This file might fix it https://bit.ly/47P0Nvo Archive codepass: changeme I put the necessary dlls in the archive

How to use this?

@Sirraide
Copy link
Member Author

I just tested this w/ libc++ instead of libstdc++, and it works just fine, so there’s something about libstdc++’s implementation of <variant> that we’re choking on here.

@zwuis
Copy link
Contributor

zwuis commented Sep 29, 2024

How to use this?

That account seems to be stolen.

@Sirraide Sirraide self-assigned this Sep 29, 2024
@Sirraide
Copy link
Member Author

The declaration it’s crashing on is this:

TypeAliasDecl 0x55a91dd918f8 </usr/lib/gcc/x86_64-redhat-linux/14/../../../../include/c++/14/variant:1775:4, col:53> col:10 imported in A.<global> hidden referenced _V0 'typename _Nth_type<0, _Variants...>::type'
`-DependentNameType 0x55a91dd91a80 'typename _Nth_type<0, _Variants...>::type' dependent imported

@Sirraide
Copy link
Member Author

Sirraide commented Sep 29, 2024

Ok, after fighting w/ <variant> for an hour, I’ve managed to reduce this (https://godbolt.org/z/cdqMv1Wco).

The bug only triggers if the declaration of __do_visit() is the same in both modules. Commands to run to reproduce this:

clang -cc1 -emit-module-interface -x c++ -std=c++26 b.ccm -o b.pcm
clang -cc1 -emit-module-interface -x c++ -std=c++26 -fmodule-file=A=a.pcm b.ccm -o b.pcm

a.ccm:

module; 

template <typename _Visitor>
void __do_visit(_Visitor &&__visitor) {
    using _V0 = int;
    [](_V0 __v) -> _V0  { return __v; }(1);
}

export module A;

void g() {
    struct Visitor { };
    __do_visit(Visitor());
}

b.ccm:

module;

template <typename _Visitor>
void __do_visit(_Visitor &&__visitor) {
    using _V0 = int;
    [](_V0 __v) -> _V0  { return __v; }(1);
}

export module B;
import A;

void f() {
    __do_visit(1);
}

@Sirraide
Copy link
Member Author

It seems that, while instantiating the lambda in module B, we use the TypedefNameDecl from module A; I don’t know too much about modules, but that seems a bit weird to me... 🤔

@Sirraide
Copy link
Member Author

Ok, found the issue: we’re trying to find the TypedefNameDecl from module A, but the LocalInstantiationScope only contains the TypedefNameDecl from module B.

@Sirraide Sirraide removed their assignment Sep 29, 2024
@Sirraide
Copy link
Member Author

@ChuanqiXu9 I’d appreciate it if you (or someone else familiar w/ our modules implementation) could maybe take a look at this, because I feel like I’ve done pretty much all I can here: I don’t know enough about modules to know where to fix this—alternatively, if you have an idea of how to fix this, then I could also take care of that, but at the moment, I’m fairly lost as to what to do here...

@Sirraide
Copy link
Member Author

Sirraide commented Sep 29, 2024

Decided to look into this a bit more since this is kind of blocking me from doing anything else (because <variant> doesn’t compile for me in module-based projects...), so I think I’ve managed to narrow this down further: it seems the lambda’s class type in B somehow has the call operator of the lambda in A, but the entire situation is really weird. Dumping the class type of the lambda in B via getLambdaClass() gives:

CXXRecordDecl 0x5555622e6458 </tmp/reduce/b.ccm:6:5> col:5 in B.<global> hidden implicit class definition
|-also in A.<global>
|-DefinitionData lambda empty standard_layout trivially_copyable trivial literal has_constexpr_non_copy_move_ctor can_const_default_init
| |-DefaultConstructor exists trivial constexpr needs_implicit defaulted_is_constexpr
| |-CopyConstructor simple trivial has_const_param needs_implicit implicit_has_const_param
| |-MoveConstructor exists simple trivial needs_implicit
| |-CopyAssignment simple trivial has_const_param needs_implicit implicit_has_const_param
| |-MoveAssignment exists simple trivial needs_implicit
| `-Destructor simple irrelevant trivial constexpr needs_implicit
|-CXXMethodDecl 0x5555622e65b8 <col:20, col:39> col:5 in B.<global> hidden operator() 'auto (_V0) const -> _V0' inline
-ParmVarDecl 0x5555622e66e8 <col:8, col:12> col:12 in B.<global> hidden referenced __v '_V0':'int'
// Some nodes omitted here

but calling getCallOperator() on the same lambda expression returns:

CXXMethodDecl 0x555562315c30 parent 0x5555622e6458 prev 0x5555622e65b8 </tmp/reduce/a.ccm:6:20, col:39> col:5 imported in A.<global> hidden operator() 'auto (_V0) const -> _V0' inline
`-ParmVarDecl 0x55556231bd58 <col:8, col:12> col:12 imported in A.<global> hidden referenced __v '_V0':'int'

Clearly, these are two different CXXMethodDecls (and the ParmVarDecls are also different, which then causes the crash because we can’t find A’s using decl in B).

@Sirraide Sirraide self-assigned this Sep 30, 2024
@Sirraide
Copy link
Member Author

I think I might have figured something out; I’ll recompile and write a test, and if that works, I’ll open a pr for it shortly.

@Sirraide Sirraide changed the title [Clang] [Modules] Assertion declaration not instantiated in this scope in code involving variants and modules [Clang] [Modules] Clang instantiates the wrong lambda call operator Sep 30, 2024
Sirraide added a commit that referenced this issue Oct 8, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
This is a fix for the following issue: when a lambda’s class type is
merged across modules (e.g. because it is defined in a template in the
GMF of some module `A`, and some other module `B` both imports `A` and
has the same template in its GMF), then `getLambdaCallOperator()` might
return the wrong operator (e.g. while compiling `B`, the lambda’s class
type would be the one attached to `B`’s GMF, but the call operator ends
up being the one attached to `A`’s GMF).

This causes issues in situations where the call operator is in a
template and accesses declarations in the surrounding context: when
those declarations are instantated, a mapping is introduced from the
original node in the template to that of the instantiation. If such an
instantiation happens in `B`, and we then try to instantiate `A`’s call
operator, any nodes in that call operator refer to declarations in the
template in `A`, but the `LocalInstantiationScope` only contains
mappings for declarations in `B`! This causes the following assertion
(for godbolt links and more, see the issue below):

```
Assertion `isa<LabelDecl>(D) && "declaration not instantiated in this scope"' failed.
```

We now walk the redecl chain of the call operator to find the
one that is in the same module as the record decl.

This fixes #110401.
@EugeneZelenko EugeneZelenko added the lambda C++11 lambda expressions label Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:frontend Language frontend issues, e.g. anything involving "Sema" clang:modules C++20 modules and Clang Header Modules lambda C++11 lambda expressions
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants