Also minor refactoring in related functions was done.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
lib/AST/ASTImporter.cpp | ||
---|---|---|
4296 ↗ | (On Diff #133189) | I usually prefer to keep the type if it doesn't give a large space win because it hurts readability a bit. From VarDecl *, we can instantly find the type; for auto, we have to look forward. (Yes, VarTemplatePartialSpecializationDecl has to be replaced immediately :) ). |
lib/AST/ASTImporter.cpp | ||
---|---|---|
2858 ↗ | (On Diff #133626) | In case of class templates, the explicit instantiation is the member of the DeclContext. It does not belong to the DeclContext only in case of implicit instantiations. @xazax.hun perhaps we should open source some of our fixes as well? |
4455 ↗ | (On Diff #133626) | This is related to my other comment, perhaps we should not add D2 to the DeclContext unconditionnally. I think only implicit instantiations should be added. See |
Just ignore my previous comments, the issue with explicit instantiations could be fixed in a separate independent patch. All is good.
lib/AST/ASTImporter.cpp | ||
---|---|---|
2858 ↗ | (On Diff #133626) | This code handles templated declarations, not template instantiations. Every TemplateDecl has an underlying templated declaration that is used while instantiating the template; it is not the same as template specialization. And it is not visible from the DeclContext it refers to via lookup. Or am I misunderstanding something? |