[PATCH] D96009: [clangd] Improve name conflict detection

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 4 04:32:53 PST 2021


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

Thanks!



================
Comment at: clang-tools-extra/clangd/refactor/Rename.cpp:343
   const auto *Parent = GetSingleParent(DynTypedNode::create(RenamedDecl));
-  if (!Parent || !Parent->get<DeclStmt>())
+  if (!Parent || !(Parent->get<DeclStmt>() || Parent->get<TypeLoc>()))
     return nullptr;
----------------
I'd use `get<FunctionProtoTypeLoc>` which seems safer -- typeLoc is a very generic class


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D96009



More information about the cfe-commits mailing list