mirror of
https://github.com/MaskRay/ccls.git
synced 2025-01-31 18:00:26 +00:00
[template] Index references to non-type template parameters
This commit is contained in:
parent
32bcac38af
commit
cff432a223
@ -1044,6 +1044,16 @@ ClangCursor::VisitResult TemplateVisitor(ClangCursor cursor,
|
|||||||
// TODO Add other containers not covered by IsFunctionCallContext
|
// TODO Add other containers not covered by IsFunctionCallContext
|
||||||
case CXCursor_ClassTemplate:
|
case CXCursor_ClassTemplate:
|
||||||
break;
|
break;
|
||||||
|
case CXCursor_DeclRefExpr: {
|
||||||
|
ClangCursor ref_cursor = clang_getCursorReferenced(cursor.cx_cursor);
|
||||||
|
if (ref_cursor.get_kind() == CXCursor_NonTypeTemplateParameter) {
|
||||||
|
IndexVar* ref_index =
|
||||||
|
data->db->Resolve(data->db->ToVarId(ref_cursor.get_usr()));
|
||||||
|
UniqueAdd(ref_index->uses, ResolveSpelling(cursor.cx_cursor));
|
||||||
|
} else
|
||||||
|
cursor.VisitChildren(&TemplateVisitor, data);
|
||||||
|
break;
|
||||||
|
}
|
||||||
case CXCursor_OverloadedDeclRef: {
|
case CXCursor_OverloadedDeclRef: {
|
||||||
unsigned num_overloaded = clang_getNumOverloadedDecls(cursor.cx_cursor);
|
unsigned num_overloaded = clang_getNumOverloadedDecls(cursor.cx_cursor);
|
||||||
for (unsigned i = 0; i != num_overloaded; i++) {
|
for (unsigned i = 0; i != num_overloaded; i++) {
|
||||||
|
Loading…
Reference in New Issue
Block a user