[PATCH] D131091: [clang][index] Index unresolved member expression as reference
Aleksandr Platonov via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Aug 19 09:03:47 PDT 2022
This revision was automatically updated to reflect the committed changes.
Closed by commit rGee648c0ce09b: [clang][index] Index unresolved member expression as reference (authored by denis-fatkulin, committed by ArcsinX).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D131091/new/
https://reviews.llvm.org/D131091
Files:
clang-tools-extra/clangd/unittests/XRefsTests.cpp
clang/lib/Index/IndexBody.cpp
clang/test/Index/Core/index-dependent-source.cpp
Index: clang/test/Index/Core/index-dependent-source.cpp
===================================================================
--- clang/test/Index/Core/index-dependent-source.cpp
+++ clang/test/Index/Core/index-dependent-source.cpp
@@ -231,3 +231,12 @@
foo<T>();
// CHECK: [[@LINE-1]]:3 | function/C | foo | c:@FT@>1#Tfoo#v# | <no-cgname> | Ref,Call,RelCall,RelCont | rel: 1
}
+
+struct Foo {
+ template <typename T> void bar();
+ // CHECK: [[@LINE-1]]:30 | instance-method/C++ | bar | c:@S at Foo@FT@>1#Tbar#v# | <no-cgname> | Decl,RelChild | rel: 1
+};
+template <typename T> void baz(Foo f) {
+ f.bar<T>();
+ // CHECK: [[@LINE-1]]:5 | instance-method/C++ | bar | c:@S at Foo@FT@>1#Tbar#v# | <no-cgname> | Ref,Call,RelCall,RelCont | rel: 1
+}
Index: clang/lib/Index/IndexBody.cpp
===================================================================
--- clang/lib/Index/IndexBody.cpp
+++ clang/lib/Index/IndexBody.cpp
@@ -468,7 +468,7 @@
return true;
}
- bool VisitUnresolvedLookupExpr(UnresolvedLookupExpr *E) {
+ bool VisitOverloadExpr(OverloadExpr *E) {
SmallVector<SymbolRelation, 4> Relations;
SymbolRoleSet Roles = getRolesForRef(E, Relations);
for (auto *D : E->decls())
Index: clang-tools-extra/clangd/unittests/XRefsTests.cpp
===================================================================
--- clang-tools-extra/clangd/unittests/XRefsTests.cpp
+++ clang-tools-extra/clangd/unittests/XRefsTests.cpp
@@ -2090,6 +2090,14 @@
[[f^oo]](s);
}
)cpp",
+ R"cpp(// unresolved member expression
+ struct Foo {
+ template <typename T> void $decl[[b^ar]](T t);
+ };
+ template <typename T> void test(Foo F, T t) {
+ F.[[bar]](t);
+ }
+ )cpp",
// Enum base
R"cpp(
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D131091.454037.patch
Type: text/x-patch
Size: 1790 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220819/1be9d1fd/attachment.bin>
More information about the cfe-commits
mailing list