[PATCH] D66647: [clangd] DefineInline action apply logic with fully qualified names

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 26 07:28:52 PDT 2019


hokein 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();
>   }
>


This is tricky, and there are also cases where the declaration doesn't provide the name of parameter, e.g. `llvm::json::Value toJSON(const CodeAction &);`. Maybe we  can overwrite the declaration signature with the definition's, or just disable the tweak on these cases.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D66647





More information about the cfe-commits mailing list