diff --git a/clang-tools-extra/clangd/unittests/XRefsTests.cpp b/clang-tools-extra/clangd/unittests/XRefsTests.cpp --- a/clang-tools-extra/clangd/unittests/XRefsTests.cpp +++ b/clang-tools-extra/clangd/unittests/XRefsTests.cpp @@ -2090,6 +2090,14 @@ [[f^oo]](s); } )cpp", + R"cpp(// unresolved member expression + struct Foo { + template void $decl[[b^ar]](T t); + }; + template void test(Foo F, T t) { + F.[[bar]](t); + } + )cpp", // Enum base R"cpp( diff --git a/clang/lib/Index/IndexBody.cpp b/clang/lib/Index/IndexBody.cpp --- a/clang/lib/Index/IndexBody.cpp +++ b/clang/lib/Index/IndexBody.cpp @@ -468,7 +468,7 @@ return true; } - bool VisitUnresolvedLookupExpr(UnresolvedLookupExpr *E) { + bool VisitOverloadExpr(OverloadExpr *E) { SmallVector Relations; SymbolRoleSet Roles = getRolesForRef(E, Relations); for (auto *D : E->decls()) diff --git a/clang/test/Index/Core/index-dependent-source.cpp b/clang/test/Index/Core/index-dependent-source.cpp --- a/clang/test/Index/Core/index-dependent-source.cpp +++ b/clang/test/Index/Core/index-dependent-source.cpp @@ -231,3 +231,12 @@ foo(); // CHECK: [[@LINE-1]]:3 | function/C | foo | c:@FT@>1#Tfoo#v# | | Ref,Call,RelCall,RelCont | rel: 1 } + +struct Foo { + template void bar(); + // CHECK: [[@LINE-1]]:30 | instance-method/C++ | bar | c:@S@Foo@FT@>1#Tbar#v# | | Decl,RelChild | rel: 1 +}; +template void baz(Foo f) { + f.bar(); + // CHECK: [[@LINE-1]]:5 | instance-method/C++ | bar | c:@S@Foo@FT@>1#Tbar#v# | | Ref,Call,RelCall,RelCont | rel: 1 +}