[clang] [C++20][Modules] Fix crash when function and lambda inside loaded from different modules (PR #109167)

Arthur Eubanks via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 4 14:39:27 PDT 2024


aeubanks wrote:

ah there's a stack trace in an asserts build of clang
```
F0000 00:00:1728077756.977871    3296 logging.cc:62] assert.h assertion failed at third_party/llvm/llvm-project/clang/lib/Sema/SemaTemplateInstantiate.cpp:4602 in llvm::PointerUnion<Decl *, LocalInstantiationScope::DeclArgumentPack *> *clang::LocalInstantiationScope::findInstantiationOf(const Decl *): isa<
LabelDecl>(D) && "declaration not instantiated in this scope"                                                                                                                                                                                                                             
    @     0x563ef889e824  __assert_fail                                                                                                                                                                                                                                                                            
    @     0x563ef47a3bf4  clang::LocalInstantiationScope::findInstantiationOf()                                                                                                                                                                                                                                    
    @     0x563ef4836942  clang::Sema::FindInstantiatedDecl()                                                                                                                                                                                                                                                      
    @     0x563ef4810491  clang::TreeTransform<>::TransformLambdaExpr()                                                                                                                                                                                                                                            
    @     0x563ef47ffb91  (anonymous namespace)::TemplateInstantiator::TransformLambdaExpr()                                                                                                                                                                                                                       
    @     0x563ef47a1dc2  clang::TreeTransform<>::TransformExprs()                                                                                                                                                                                                                                                 
    @     0x563ef480293d  clang::TreeTransform<>::TransformCallExpr()                                                                                                                                                                                                                                              
    @     0x563ef479f7fa  clang::TreeTransform<>::TransformStmt()                                                                                                                                                                                                                                                  
    @     0x563ef4809f34  clang::TreeTransform<>::TransformCompoundStmt()                                                                                                                                                                                                                                          
    @     0x563ef479f788  clang::Sema::SubstStmt()                                                                                                                                                                                                                                                                 
    @     0x563ef484a01d  clang::Sema::InstantiateFunctionDefinition()                                                                                                                                                                                                                                             
    @     0x563ef484d0bf  clang::Sema::PerformPendingInstantiations()                                                                                                                                                                                                                                              
    @     0x563ef484a108  clang::Sema::InstantiateFunctionDefinition()                                                                                                                                                                                                                                             
    @     0x563ef484d0bf  clang::Sema::PerformPendingInstantiations()                                                                                                                                                                                                                                              
    @     0x563ef484a108  clang::Sema::InstantiateFunctionDefinition()                                                                                                                                                                                                                                             
    @     0x563ef484d0bf  clang::Sema::PerformPendingInstantiations()                                                                                                                                                                                                                                              
    @     0x563ef484a108  clang::Sema::InstantiateFunctionDefinition()                                                                                                                                                                                                                                             
    @     0x563ef484d0bf  clang::Sema::PerformPendingInstantiations()                                                                                                                                                                                                                                              
    @     0x563ef3dbb8fb  clang::Sema::ActOnEndOfTranslationUnitFragment()                                                                                                                                                                                                                                         
    @     0x563ef3dbc021  clang::Sema::ActOnEndOfTranslationUnit()                                                                                                                                                                                                                                                 
    @     0x563ef3ae663a  clang::Parser::ParseTopLevelDecl()                                                                                                                                                                                                                                                       
```

still trying to reduce the reproducer...

https://github.com/llvm/llvm-project/pull/109167


More information about the cfe-commits mailing list