forked from OSchip/llvm-project
This patch (thanks to Doug Gregor) fixes a
problem where Clang was setting the hasExternalVisibleDecls() bit for all DeclContexts it imported. This caused Clang to make unnecessary calls to findExternalVisibleDecls() when an external AST source was installed. In fact, Clang sometimes interpreted a failure by one of these spurious calls to find a Decl as meaning the Decl didn't exist, even though findExternalLexicalDecls() did locate that decl. This produced amusing errors of the form: - error: no member named 'b' in 'A'; did you mean 'b'? - Now, if hasExternalVisibleDecls() or hasExternalLexicalDecls() should be set, the external AST source must do so itself. llvm-svn: 135824
This commit is contained in:
parent
801e0a3fde
commit
81d577c5c9
|
@ -1767,10 +1767,7 @@ ASTNodeImporter::ImportDeclarationNameLoc(const DeclarationNameInfo &From,
|
|||
|
||||
void ASTNodeImporter::ImportDeclContext(DeclContext *FromDC, bool ForceImport) {
|
||||
if (Importer.isMinimalImport() && !ForceImport) {
|
||||
if (DeclContext *ToDC = Importer.ImportContext(FromDC)) {
|
||||
ToDC->setHasExternalLexicalStorage();
|
||||
ToDC->setHasExternalVisibleStorage();
|
||||
}
|
||||
Importer.ImportContext(FromDC);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue