[PATCH] D98424: [clangd] Reject renames to non-identifier characters
Nathan James via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Mar 11 07:04:04 PST 2021
njames93 added inline comments.
================
Comment at: clang-tools-extra/clangd/refactor/Rename.cpp:473-488
+static bool mayBeValidIdentifier(llvm::StringRef Ident) {
+ assert(llvm::json::isUTF8(Ident));
+ if (Ident.empty())
+ return false;
+ // We don't check all the rules for non-ascii characters (most are allowed).
+ bool AllowDollar = true; // lenient
+ if (llvm::isASCII(Ident.front()) &&
----------------
What's wrong with `isValidIdentifier` in `CharInfo.h`.
Also isIdentifier(Body|Head) cover isASCII.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D98424/new/
https://reviews.llvm.org/D98424
More information about the cfe-commits
mailing list