diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2019-01-19 10:04:05 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2019-01-19 10:04:05 +0000 |
| commit | 676fbe8105eeb6ff4bb2ed261cb212fcfdbe7b63 (patch) | |
| tree | 02a1ac369cb734d0abfa5000dd86e5b7797e6a74 /lib/Index/IndexTypeSourceInfo.cpp | |
| parent | c7e70c433efc6953dc3888b9fbf9f3512d7da2b0 (diff) | |
Notes
Diffstat (limited to 'lib/Index/IndexTypeSourceInfo.cpp')
| -rw-r--r-- | lib/Index/IndexTypeSourceInfo.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/Index/IndexTypeSourceInfo.cpp b/lib/Index/IndexTypeSourceInfo.cpp index 4b6bfbc67eff..85afc6345053 100644 --- a/lib/Index/IndexTypeSourceInfo.cpp +++ b/lib/Index/IndexTypeSourceInfo.cpp @@ -100,7 +100,8 @@ public: bool VisitTagTypeLoc(TagTypeLoc TL) { TagDecl *D = TL.getDecl(); - if (D->getParentFunctionOrMethod()) + if (!IndexCtx.shouldIndexFunctionLocalSymbols() && + D->getParentFunctionOrMethod()) return true; if (TL.isDefinition()) { @@ -130,14 +131,15 @@ public: bool HandleTemplateSpecializationTypeLoc(TypeLocType TL) { if (const auto *T = TL.getTypePtr()) { if (IndexCtx.shouldIndexImplicitInstantiation()) { - if (CXXRecordDecl *RD = T->getAsCXXRecordDecl()) + if (CXXRecordDecl *RD = T->getAsCXXRecordDecl()) { IndexCtx.handleReference(RD, TL.getTemplateNameLoc(), Parent, ParentDC, SymbolRoleSet(), Relations); - } else { - if (const TemplateDecl *D = T->getTemplateName().getAsTemplateDecl()) - IndexCtx.handleReference(D, TL.getTemplateNameLoc(), - Parent, ParentDC, SymbolRoleSet(), Relations); + return true; + } } + if (const TemplateDecl *D = T->getTemplateName().getAsTemplateDecl()) + IndexCtx.handleReference(D, TL.getTemplateNameLoc(), Parent, ParentDC, + SymbolRoleSet(), Relations); } return true; } |
