summaryrefslogtreecommitdiffstats
path: root/clang/lib/Index/IndexingContext.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Index/IndexingContext.cpp')
-rw-r--r--clang/lib/Index/IndexingContext.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/clang/lib/Index/IndexingContext.cpp b/clang/lib/Index/IndexingContext.cpp
index 3d2d7d4ff02..d01dd50f3b5 100644
--- a/clang/lib/Index/IndexingContext.cpp
+++ b/clang/lib/Index/IndexingContext.cpp
@@ -44,6 +44,10 @@ bool IndexingContext::shouldIndexParametersInDeclarations() const {
return IndexOpts.IndexParametersInDeclarations;
}
+bool IndexingContext::shouldIndexTemplateParameters() const {
+ return IndexOpts.IndexTemplateParameters;
+}
+
bool IndexingContext::handleDecl(const Decl *D,
SymbolRoleSet Roles,
ArrayRef<SymbolRelation> Relations) {
@@ -76,8 +80,11 @@ bool IndexingContext::handleReference(const NamedDecl *D, SourceLocation Loc,
if (!shouldIndexFunctionLocalSymbols() && isFunctionLocalSymbol(D))
return true;
- if (isa<NonTypeTemplateParmDecl>(D) || isa<TemplateTypeParmDecl>(D))
+ if (!shouldIndexTemplateParameters() &&
+ (isa<NonTypeTemplateParmDecl>(D) || isa<TemplateTypeParmDecl>(D) ||
+ isa<TemplateTemplateParmDecl>(D))) {
return true;
+ }
return handleDeclOccurrence(D, Loc, /*IsRef=*/true, Parent, Roles, Relations,
RefE, RefD, DC);
OpenPOWER on IntegriCloud