Closed martong closed 5 years ago
It seems that we do not know exactly what to put into the lookup table in these cases. The table should be correct not only for the purpose of ASTImporter
(do not change contents of it only to make ASTImporter
work).
The table should be correct not only for the purpose of ASTImporter (do not change contents of it only to make ASTImporter work).
Yes, exactly. We used to abuse the normal lookup and put otherwise nonvisible decls into the normal lookup table, merely for the purpose of ASTImporter.
This seems the right way to handle friends, ASTImport logic should be self-enclosed, and the observed behaviour unaltered with respect to other consumers of the produced AST.
In the past we had to use
DeclContext::makeDeclVisibleInContext
to make friend declarations available for subsequent lookup calls and this way we could chain (redecl) the structurally equivalent decls. Since we use the importer specific lookup this is no longer necessary, because with that we can find every previous nodes.