[PATCH] D133415: [clangd] Fix non-idempotent cases of canonicalRenameDecl()

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 5 12:20:44 PDT 2022


sammccall marked an inline comment as done.
sammccall added inline comments.


================
Comment at: clang-tools-extra/clangd/unittests/RenameTests.cpp:1521
           R"cpp(
         template <typename> class Foo { virtual void [[m]](); };
         class Bar : Foo<int> { void [[^m]]() override; };
----------------
ilya-biryukov wrote:
> Quick question to help better understand our current behavior. Not requesting to change anything here, just wanted to make sure what we're doing now.
> 
> If we run the rename inside the primary template itself, are we going to rename the use in `Bar`?
> I suspect the answer is "yes" because it's in the same file, so we get it from the AST and not from the index. Just to make sure.
> 
Yes, I just checked - this example works in both directions. And indeed it's because the index isn't involved.

Filed https://github.com/clangd/clangd/issues/1325 for the index issue.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D133415



More information about the cfe-commits mailing list