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

Ilya Biryukov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 19 01:25:36 PDT 2019


ilya-biryukov added inline comments.


================
Comment at: clang-tools-extra/clangd/refactor/tweaks/DefineInline.cpp:158
+      //  i.e: a::Bar<Bar<T>> instead of a::Bar<a::Bar<T>>
+      printTemplateArgumentList(OS, TSTL.getTypePtr()->template_arguments(),
+                                TD->getASTContext().getPrintingPolicy());
----------------
Are we trying to replace the whole name?

We can avoid this problem by not qualifying template arguments in the first place.
I.e. instead of replacing the whole name, including template arguments:
```
[[baz<Bar>]] -> [[::ns::baz<Bar>]]
```
We could simply replace the part before template arguments:
```
[[baz]]<Bar> -> [[::ns::baz]]<Bar>
```


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