kadircet added a comment.

In D66647#1684046 <https://reviews.llvm.org/D66647#1684046>, @ilya-biryukov 
wrote:

> We also need to rename parameters sometimes, right?
>
>   // Sometimes we need to rename parameters.
>   void usages(int decl_param, int);
>  
>   void usages(int def_param, int now_named) {
>     llvm::errs() << def_param + now_named;
>   }
>  
>   // And template parameters! (these are even more interesting)
>   template <class T>
>   struct Foo {
>     template <class U, class>
>     void usages();
>   };
>   template <class L>
>   template <class R, class NowNamed>
>   void Foo<L>::usages() {
>     llvm::errs() << L() + R() + NowNamed();
>   }
>


So currently AST doesn't store any information regarding template parameter 
locations except the deepest one.
Therefore I've changed the availability to discard any methods inside templated 
classes, since there is no way to
validate the template parameter names. Hopefully this should be a rare 
use-case, and I believe most of the times
people have same template paramater names on declaration and definition. Let me 
know what you think about
it.

In addition to that implemented renaming for function parameters and template 
parameters in case of templated
functions.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D66647/new/

https://reviews.llvm.org/D66647



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

Reply via email to