diff options
Diffstat (limited to 'clang/lib/Index/IndexDecl.cpp')
-rw-r--r-- | clang/lib/Index/IndexDecl.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/clang/lib/Index/IndexDecl.cpp b/clang/lib/Index/IndexDecl.cpp index e14750e046e..f1ef6c0ea21 100644 --- a/clang/lib/Index/IndexDecl.cpp +++ b/clang/lib/Index/IndexDecl.cpp @@ -664,8 +664,11 @@ public: bool VisitTemplateDecl(const TemplateDecl *D) { - // Index the default values for the template parameters. const NamedDecl *Parent = D->getTemplatedDecl(); + if (!Parent) + return true; + + // Index the default values for the template parameters. if (D->getTemplateParameters() && shouldIndexTemplateParameterDefaultValue(Parent)) { const TemplateParameterList *Params = D->getTemplateParameters(); @@ -684,7 +687,7 @@ public: } } - return Visit(D->getTemplatedDecl()); + return Visit(Parent); } bool VisitFriendDecl(const FriendDecl *D) { |