File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed
Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -4442,19 +4442,16 @@ class ASTDeclContextNameLookupTrait
44424442 DeclIDs.push_back (ID);
44434443 };
44444444 for (NamedDecl *D : Decls) {
4445- if (isa<NamespaceDecl>(D) && D->isFromASTFile ()) {
4445+ if (ASTReader *Chain = Writer.getChain ();
4446+ Chain && isa<NamespaceDecl>(D) && D->isFromASTFile () &&
4447+ D == Chain->getKeyDeclaration (D)) {
44464448 // In ASTReader, we stored only the key declaration of a namespace decl
44474449 // for this TU rather than storing all of the key declarations from each
44484450 // imported module. If we have an external namespace decl, this is that
44494451 // key declaration and we need to re-expand it to write out all of the
44504452 // key declarations from each imported module again.
44514453 //
44524454 // See comment 'ASTReader::FindExternalVisibleDeclsByName' for details.
4453- ASTReader *Chain = Writer.getChain ();
4454- assert (Chain && " An external namespace decl without an ASTReader" );
4455- assert (D == Chain->getKeyDeclaration (D) &&
4456- " An external namespace decl that is not "
4457- " the key declaration of this TU" );
44584455 Chain->forEachImportedKeyDecl (D, [&AddDecl](const Decl *D) {
44594456 AddDecl (cast<NamedDecl>(const_cast <Decl *>(D)));
44604457 });
You can’t perform that action at this time.
0 commit comments