This is an archive of the discontinued LLVM Phabricator instance.

[ASTImporter] Import described template (if any) of function.
ClosedPublic

Authored by balazske on Jul 12 2018, 7:10 AM.

Details

Summary

When a function is imported, check if it has a described template.
The name lookup is corrected to find the templated entity in this case.
The described template of the function is imported too.

Diff Detail

Repository
rC Clang

Event Timeline

balazske created this revision.Jul 12 2018, 7:10 AM

Hello Balasz,
This looks mostly good but I have a question inline.

lib/AST/ASTImporter.cpp
2755

The function template should be already set after getDescribedFunctionTemplate() is imported in VisitFunctionTemplateDecl(). Are there still cases not covered by this?

balazske added inline comments.Jul 16 2018, 1:07 AM
lib/AST/ASTImporter.cpp
2755

Yes this call can be omitted. But check of return value of Import is needed (the current code is not good: nullptr is not accepted by dyn_cast).

balazske updated this revision to Diff 155630.Jul 16 2018, 1:59 AM
  • Removed setDescribedFunctionTemplate call.
This revision is now accepted and ready to land.Jul 16 2018, 3:53 PM
This revision was automatically updated to reflect the committed changes.