sepavloff added a comment.

In https://reviews.llvm.org/D21767#1197783, @rjmccall wrote:

> Shouldn't there just be a link in the AST from the instantiated 
> `FunctionTemplateDecl ` back to the original pattern?  Maybe a generalization 
> of `InstantiatedFromMember` in `RedeclarablableTemplateDecl`?


The field `InstantiatedFromMember` indeed helps finding function template 
definition, this patch only modifies search algorithm to make it suitable for 
friend templates. Friend function templates have dual nature, they may be 
members of redeclaration chains, like usual namespace level function templates 
and still use `InstantiatedFromMember` like member function templates. So the 
resulting search algorithm (implemented in `getPatternFor`) scans both 
redeclaration chain and the chain formed by `InstantiatedFromMember`.


Repository:
  rC Clang

https://reviews.llvm.org/D21767



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to