hokein created this revision. hokein added a reviewer: usaxena95. Herald added subscribers: kadircet, arphaman. hokein requested review of this revision. Herald added a subscriber: ilya-biryukov. Herald added a project: clang.
Fix https://github.com/clangd/clangd/issues/675 Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D96262 Files: 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 @@ -224,3 +224,10 @@ // CHECK: [[@LINE+1]]:9 | struct(Gen)/C++ | UsingD | c:@ST>1#T@UsingD | <no-cgname> | Ref,RelCont | rel: 1 using UsingD<U>::foo; }; + +template <typename T> void foo(); +// CHECK: [[@LINE-1]]:28 | function/C | foo | c:@FT@>1#Tfoo#v# | <no-cgname> | Decl | rel: 0 +template <typename T> void bar() { + foo<T>(); +// CHECK: [[@LINE-1]]:3 | function/C | foo | c:@FT@>1#Tfoo#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 @@ -466,6 +466,15 @@ } return true; } + + bool VisitUnresolvedLookupExpr(UnresolvedLookupExpr *E) { + SmallVector<SymbolRelation, 4> Relations; + SymbolRoleSet Roles = getRolesForRef(E, Relations); + for (auto *D : E->decls()) + IndexCtx.handleReference(D, E->getNameLoc(), Parent, ParentDC, Roles, + Relations, E); + return true; + } }; } // anonymous namespace
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 @@ -224,3 +224,10 @@ // CHECK: [[@LINE+1]]:9 | struct(Gen)/C++ | UsingD | c:@ST>1#T@UsingD | <no-cgname> | Ref,RelCont | rel: 1 using UsingD<U>::foo; }; + +template <typename T> void foo(); +// CHECK: [[@LINE-1]]:28 | function/C | foo | c:@FT@>1#Tfoo#v# | <no-cgname> | Decl | rel: 0 +template <typename T> void bar() { + foo<T>(); +// CHECK: [[@LINE-1]]:3 | function/C | foo | c:@FT@>1#Tfoo#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 @@ -466,6 +466,15 @@ } return true; } + + bool VisitUnresolvedLookupExpr(UnresolvedLookupExpr *E) { + SmallVector<SymbolRelation, 4> Relations; + SymbolRoleSet Roles = getRolesForRef(E, Relations); + for (auto *D : E->decls()) + IndexCtx.handleReference(D, E->getNameLoc(), Parent, ParentDC, Roles, + Relations, E); + return true; + } }; } // anonymous namespace
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits