[PATCH] D38755: Fixed crash during indexing default template template param
Phabricator via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Oct 10 14:10:11 PDT 2017
This revision was automatically updated to reflect the committed changes.
Closed by commit rL315367: Fix indexer crash for default template template parameter value (authored by jkorous).
Changed prior to commit:
https://reviews.llvm.org/D38755?vs=118451&id=118476#toc
Repository:
rL LLVM
https://reviews.llvm.org/D38755
Files:
cfe/trunk/lib/Index/IndexDecl.cpp
cfe/trunk/test/Index/index-template-template-param.cpp
Index: cfe/trunk/lib/Index/IndexDecl.cpp
===================================================================
--- cfe/trunk/lib/Index/IndexDecl.cpp
+++ cfe/trunk/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());
}
}
}
Index: cfe/trunk/test/Index/index-template-template-param.cpp
===================================================================
--- cfe/trunk/test/Index/index-template-template-param.cpp
+++ cfe/trunk/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 |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D38755.118476.patch
Type: text/x-patch
Size: 1319 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20171010/29f9d0c8/attachment.bin>
More information about the cfe-commits
mailing list