Fix crash when referring to a C++ variable whose type's scope has not been imported. (#6743)

This commit is contained in:
Richard Smith
2026-02-16 22:47:01 +00:00
committed by GitHub
parent 0300d35cf6
commit 1aa1a2a373
3 changed files with 81 additions and 94 deletions
+2
View File
@@ -1673,6 +1673,8 @@ static auto AddDependentUnimportedDecls(Context& context,
context, type_decl->getASTContext().getTypeDeclType(type_decl),
worklist);
}
} else if (auto* var_decl = dyn_cast<clang::VarDecl>(clang_decl)) {
AddDependentUnimportedTypeDecls(context, var_decl->getType(), worklist);
}
auto* parent = GetParentDecl(clang_decl);
if (llvm::isa_and_nonnull<clang::TagDecl, clang::NamespaceDecl,