[PATCH] D136259: Fix crash in constraining partial specialization on nested template.
Utkarsh Saxena via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Oct 19 07:51:06 PDT 2022
usaxena95 created this revision.
Herald added a project: All.
usaxena95 requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
Fixes: https://github.com/llvm/llvm-project/issues/53354
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D136259
Files:
clang/lib/Sema/SemaTemplateDeduction.cpp
Index: clang/lib/Sema/SemaTemplateDeduction.cpp
===================================================================
--- clang/lib/Sema/SemaTemplateDeduction.cpp
+++ clang/lib/Sema/SemaTemplateDeduction.cpp
@@ -5804,10 +5804,10 @@
}
bool TraverseTemplateName(TemplateName Template) {
- if (auto *TTP =
- dyn_cast<TemplateTemplateParmDecl>(Template.getAsTemplateDecl()))
- if (TTP->getDepth() == Depth)
- Used[TTP->getIndex()] = true;
+ if (TemplateDecl *TD = Template.getAsTemplateDecl())
+ if (auto *TTP = dyn_cast<TemplateTemplateParmDecl>(TD))
+ if (TTP->getDepth() == Depth)
+ Used[TTP->getIndex()] = true;
RecursiveASTVisitor<MarkUsedTemplateParameterVisitor>::
TraverseTemplateName(Template);
return true;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D136259.468913.patch
Type: text/x-patch
Size: 788 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20221019/c7ff95b1/attachment.bin>
More information about the cfe-commits
mailing list