[clang-tools-extra] r364284 - [clangd] Fix NestedNameSpecifierLoc in SelectionTree
Sam McCall via cfe-commits
cfe-commits at lists.llvm.org
Tue Jun 25 02:36:09 PDT 2019
Author: sammccall
Date: Tue Jun 25 02:36:09 2019
New Revision: 364284
URL: http://llvm.org/viewvc/llvm-project?rev=364284&view=rev
Log:
[clangd] Fix NestedNameSpecifierLoc in SelectionTree
Reviewers: kadircet
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D63708
Modified:
clang-tools-extra/trunk/clangd/Selection.cpp
clang-tools-extra/trunk/clangd/unittests/SelectionTests.cpp
Modified: clang-tools-extra/trunk/clangd/Selection.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/Selection.cpp?rev=364284&r1=364283&r2=364284&view=diff
==============================================================================
--- clang-tools-extra/trunk/clangd/Selection.cpp (original)
+++ clang-tools-extra/trunk/clangd/Selection.cpp Tue Jun 25 02:36:09 2019
@@ -61,7 +61,7 @@ public:
bool TraverseTypeLoc(TypeLoc X) {
return traverseNode(&X, [&] { return Base::TraverseTypeLoc(X); });
}
- bool TraverseTypeNestedNameSpecifierLoc(NestedNameSpecifierLoc X) {
+ bool TraverseNestedNameSpecifierLoc(NestedNameSpecifierLoc X) {
return traverseNode(
&X, [&] { return Base::TraverseNestedNameSpecifierLoc(X); });
}
Modified: clang-tools-extra/trunk/clangd/unittests/SelectionTests.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/unittests/SelectionTests.cpp?rev=364284&r1=364283&r2=364284&view=diff
==============================================================================
--- clang-tools-extra/trunk/clangd/unittests/SelectionTests.cpp (original)
+++ clang-tools-extra/trunk/clangd/unittests/SelectionTests.cpp Tue Jun 25 02:36:09 2019
@@ -92,6 +92,13 @@ TEST(SelectionTest, CommonAncestor) {
Case Cases[] = {
{
R"cpp(
+ template <typename T>
+ int x = [[T::^U::]]ccc();
+ )cpp",
+ "NestedNameSpecifierLoc",
+ },
+ {
+ R"cpp(
struct AAA { struct BBB { static int ccc(); };};
int x = AAA::[[B^B^B]]::ccc();
)cpp",
@@ -184,8 +191,7 @@ TEST(SelectionTest, CommonAncestor) {
template <[[template<class> class /*cursor here*/^U]]>
struct Foo<U<int>*> {};
)cpp",
- "TemplateTemplateParmDecl"
- },
+ "TemplateTemplateParmDecl"},
};
for (const Case &C : Cases) {
Annotations Test(C.Code);
More information about the cfe-commits
mailing list