[PATCH] D75174: [clangd] use printQualifiedName to skip the inlinenamespace qualifiers.
Haojian Wu via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Feb 26 06:26:07 PST 2020
hokein created this revision.
hokein added a reviewer: kadircet.
Herald added subscribers: usaxena95, arphaman, jkorous, MaskRay, ilya-biryukov.
Herald added a project: clang.
symbols in libcpp are inside the inline namespace, printQualifierAsString will
print the inline namespace, which is unexpected.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D75174
Files:
clang-tools-extra/clangd/refactor/Rename.cpp
clang-tools-extra/clangd/unittests/RenameTests.cpp
Index: clang-tools-extra/clangd/unittests/RenameTests.cpp
===================================================================
--- clang-tools-extra/clangd/unittests/RenameTests.cpp
+++ clang-tools-extra/clangd/unittests/RenameTests.cpp
@@ -593,6 +593,14 @@
}
)cpp",
"not a supported kind", !HeaderFile, Index},
+ {R"cpp(// disallow rename on blacklisted symbols (e.g. std symbols)
+ namespace std {
+ inline namespace __u {
+ class str^ing {};
+ }
+ }
+ )cpp",
+ "not a supported kind", !HeaderFile, Index},
{R"cpp(
void foo(int);
Index: clang-tools-extra/clangd/refactor/Rename.cpp
===================================================================
--- clang-tools-extra/clangd/refactor/Rename.cpp
+++ clang-tools-extra/clangd/refactor/Rename.cpp
@@ -110,7 +110,7 @@
#include "StdSymbolMap.inc"
#undef SYMBOL
});
- return StdSymbols->count(RenameDecl.getQualifiedNameAsString());
+ return StdSymbols->count(printQualifiedName(RenameDecl));
}
enum ReasonToReject {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D75174.246699.patch
Type: text/x-patch
Size: 1080 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200226/78a9dadc/attachment.bin>
More information about the cfe-commits
mailing list