[PATCH] D38755: Fixed crash during indexing default template template param
Jan Korous via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Oct 10 12:26:59 PDT 2017
jkorous-apple created this revision.
fix + testcase
https://reviews.llvm.org/D38755
Files:
lib/Index/IndexDecl.cpp
test/Index/index-template-template-param.cpp
Index: test/Index/index-template-template-param.cpp
===================================================================
--- /dev/null
+++ test/Index/index-template-template-param.cpp
@@ -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 |
Index: lib/Index/IndexDecl.cpp
===================================================================
--- lib/Index/IndexDecl.cpp
+++ lib/Index/IndexDecl.cpp
@@ -666,7 +666,6 @@
}
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 @@
} else if (const auto *TTPD = dyn_cast<TemplateTemplateParmDecl>(TP)) {
if (TTPD->hasDefaultArgument())
handleTemplateArgumentLoc(TTPD->getDefaultArgument(), Parent,
- /*DC=*/nullptr);
+ TP->getLexicalDeclContext());
}
}
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D38755.118451.patch
Type: text/x-patch
Size: 1224 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20171010/6effdb68/attachment.bin>
More information about the cfe-commits
mailing list