[PATCH] D88875: [clangd] Add basic keyword-name-validation in rename.

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 6 06:42:57 PDT 2020


hokein added inline comments.


================
Comment at: clang-tools-extra/clangd/ClangdServer.cpp:416
+    auto Results = clangd::rename(
+        {Pos, /*NewName=*/"__clangd_rename_dummy", InpAST->AST, File,
+         RenameOpts.AllowCrossFile ? nullptr : Index, RenameOpts});
----------------
sammccall wrote:
> oh, reserved name is clever :-)
> 
> Though it occurs to me - we could actually warn on rename to a reserved name!
> (We can still do this and just ignore __clangd_*)
giving a warning is nice, it seems too strict to forbidden users (library developers)) renaming a symbol to `__a` . The code is still compilable after all.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D88875



More information about the cfe-commits mailing list