summaryrefslogtreecommitdiffstats
path: root/tools/libclang/IndexTypeSourceInfo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/libclang/IndexTypeSourceInfo.cpp')
-rw-r--r--tools/libclang/IndexTypeSourceInfo.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/tools/libclang/IndexTypeSourceInfo.cpp b/tools/libclang/IndexTypeSourceInfo.cpp
index 1e75378105..34acffcf7a 100644
--- a/tools/libclang/IndexTypeSourceInfo.cpp
+++ b/tools/libclang/IndexTypeSourceInfo.cpp
@@ -73,9 +73,15 @@ public:
bool VisitTemplateSpecializationTypeLoc(TemplateSpecializationTypeLoc TL) {
if (const TemplateSpecializationType *T = TL.getTypePtr()) {
- if (CXXRecordDecl *RD = T->getAsCXXRecordDecl())
- IndexCtx.handleReference(RD, TL.getTemplateNameLoc(),
- Parent, ParentDC);
+ if (IndexCtx.shouldIndexImplicitTemplateInsts()) {
+ if (CXXRecordDecl *RD = T->getAsCXXRecordDecl())
+ IndexCtx.handleReference(RD, TL.getTemplateNameLoc(),
+ Parent, ParentDC);
+ } else {
+ if (const TemplateDecl *D = T->getTemplateName().getAsTemplateDecl())
+ IndexCtx.handleReference(D, TL.getTemplateNameLoc(),
+ Parent, ParentDC);
+ }
}
return true;
}