[PATCH] D135489: [clangd] Fix rename for symbol introduced by UsingDecl

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Oct 8 10:34:41 PDT 2022


sammccall accepted this revision.
sammccall added a comment.
This revision is now accepted and ready to land.

Thanks!



================
Comment at: clang-tools-extra/clangd/refactor/Rename.cpp:169
+// For renaming, we're only interested in foo's declaration, so drop the other one
+void filterUsingDecl(llvm::DenseSet<const NamedDecl *>& Decls) {
+  // There should never be more than one UsingDecl here, 
----------------
you might want to call this `filterRenameTargets` or something, with the idea that we may add restrictions other than UsingDecl in future


================
Comment at: clang-tools-extra/clangd/refactor/Rename.cpp:170
+void filterUsingDecl(llvm::DenseSet<const NamedDecl *>& Decls) {
+  // There should never be more than one UsingDecl here, 
+  // otherwise the rename would be ambiguos anyway.
----------------
nit: `llvm::erase_if(Decls, [](const NamedDecl *D) { ... })`?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D135489



More information about the cfe-commits mailing list