[PATCH] D63872: [clangd] Fix a case where we fail to detect a header-declared symbol in rename.

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 27 05:16:31 PDT 2019


sammccall added inline comments.


================
Comment at: clang-tools-extra/clangd/refactor/Rename.cpp:157
   assert(RenameDecl && "symbol must be found at this point");
+  RenameDecl = cast<NamedDecl>(RenameDecl->getCanonicalDecl());
   if (auto Reject = renamableWithinFile(*RenameDecl, File, Index)) {
----------------
This cast isn't safe. I can't remember the exact case, but if you really need a NamedDecl you need to decide what to do if the canonical one isn't.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D63872





More information about the cfe-commits mailing list