From ba1ca37326ec27c63f132b4aca93ed66d67095a3 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Wed, 20 Dec 2017 23:18:48 -0800 Subject: [PATCH] [indexer] Make $cquery/base find correct overriden functions (#169) --- src/indexer.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/indexer.cc b/src/indexer.cc index 3bcde7de..397d69d1 100644 --- a/src/indexer.cc +++ b/src/indexer.cc @@ -1211,7 +1211,9 @@ void OnIndexDeclaration(CXClientData client_data, const CXIdxDeclInfo* decl) { &num_overridden); for (unsigned i = 0; i < num_overridden; ++i) { - ClangCursor parent = overridden[i]; + ClangCursor parent = + ClangCursor(overridden[i]) + .template_specialization_to_template_definition(); IndexFuncId parent_id = db->ToFuncId(parent.get_usr()); IndexFunc* parent_def = db->Resolve(parent_id); func = db->Resolve(func_id); // ToFuncId invalidated func_def