File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
include/clang/Serialization Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -544,7 +544,13 @@ class ASTReader
544544 // / to ensure that the definition for related decls comes from the same module
545545 // / as the enclosing main decl. Without this, due to lazy deserialization,
546546 // / the definition for the main decl and related decls may come from different
547- // / modules.
547+ // / modules. It is used for the following cases:
548+ // / - Lambda inside a template function definition: The main declaration is
549+ // / the enclosing function, and the related declarations are the lambda
550+ // / declarations.
551+ // / - Friend function defined inside a template CXXRecord declaration: The
552+ // / main declaration is the enclosing record, and the related declarations
553+ // / are the friend functions.
548554 llvm::DenseMap<GlobalDeclID, SmallVector<GlobalDeclID, 4 >> RelatedDeclsMap;
549555
550556 struct PendingUpdateRecord {
Original file line number Diff line number Diff line change @@ -817,7 +817,7 @@ void ASTDeclWriter::VisitFunctionDecl(FunctionDecl *D) {
817817 // force the definition to be the one inside the definition of the template
818818 // class. Remember this relation to deserialize them together.
819819 if (auto *RD = dyn_cast<CXXRecordDecl>(D->getLexicalParent ());
820- isDefinitionInDependentContext (RD)) {
820+ RD && isDefinitionInDependentContext (RD)) {
821821 Writer.RelatedDeclsMap [Writer.GetDeclRef (RD)].push_back (
822822 Writer.GetDeclRef (D));
823823 }
You can’t perform that action at this time.
0 commit comments