r315367 - Fix indexer crash for default template template parameter value
Jan Korous via cfe-commits
cfe-commits at lists.llvm.org
Tue Oct 10 14:09:49 PDT 2017
Author: jkorous
Date: Tue Oct 10 14:09:49 2017
New Revision: 315367
URL: http://llvm.org/viewvc/llvm-project?rev=315367&view=rev
Log:
Fix indexer crash for default template template parameter value
rdar://33058798
Differential Revision: https://reviews.llvm.org/D38755
Added:
cfe/trunk/test/Index/index-template-template-param.cpp
Modified:
cfe/trunk/lib/Index/IndexDecl.cpp
Modified: cfe/trunk/lib/Index/IndexDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Index/IndexDecl.cpp?rev=315367&r1=315366&r2=315367&view=diff
==============================================================================
--- cfe/trunk/lib/Index/IndexDecl.cpp (original)
+++ cfe/trunk/lib/Index/IndexDecl.cpp Tue Oct 10 14:09:49 2017
@@ -666,7 +666,6 @@ public:
}
bool VisitTemplateDecl(const TemplateDecl *D) {
- // FIXME: Template parameters.
// Index the default values for the template parameters.
const NamedDecl *Parent = D->getTemplatedDecl();
@@ -683,7 +682,7 @@ public:
} else if (const auto *TTPD = dyn_cast<TemplateTemplateParmDecl>(TP)) {
if (TTPD->hasDefaultArgument())
handleTemplateArgumentLoc(TTPD->getDefaultArgument(), Parent,
- /*DC=*/nullptr);
+ TP->getLexicalDeclContext());
}
}
}
Added: cfe/trunk/test/Index/index-template-template-param.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/index-template-template-param.cpp?rev=315367&view=auto
==============================================================================
--- cfe/trunk/test/Index/index-template-template-param.cpp (added)
+++ cfe/trunk/test/Index/index-template-template-param.cpp Tue Oct 10 14:09:49 2017
@@ -0,0 +1,7 @@
+// RUN: c-index-test -index-file %s -x objective-c++ | FileCheck %s
+
+template <typename T> class Template1 {};
+
+template <template <class> class TMPL = Template1> class Template2;
+
+// CHECK: [indexEntityReference]: kind: c++-class-template | name: Template1 |
More information about the cfe-commits
mailing list