summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaTemplateInstantiate.cpp
diff options
context:
space:
mode:
authorSaar Raz <saar@raz.email>2020-03-06 18:45:12 +0200
committerSaar Raz <saar@raz.email>2020-03-06 19:34:43 +0200
commit7c18c2f709e9a1009c120ff31863799a1279c3b1 (patch)
tree3a41953975e5116e7311adb4ea68a01e9952a79d /clang/lib/Sema/SemaTemplateInstantiate.cpp
parentedcd83a669b68a2d371a54dc46e647a2efe97a4f (diff)
downloadbcm5719-llvm-7c18c2f709e9a1009c120ff31863799a1279c3b1.tar.gz
bcm5719-llvm-7c18c2f709e9a1009c120ff31863799a1279c3b1.zip
[Concepts] Add null check for TemplateTypeParmType::getDecl() in GetContainedInventedTypeParmVisitor
GetContainedInventedTypeParmVisitor would not account for the case where TemplateTypeParmType::getDecl() is nullptr, causing bug #45102. Add the nullptr check. (cherry picked from commit 865456d589e093582acaafd17d58ad1c0cce66af)
Diffstat (limited to 'clang/lib/Sema/SemaTemplateInstantiate.cpp')
-rw-r--r--clang/lib/Sema/SemaTemplateInstantiate.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaTemplateInstantiate.cpp b/clang/lib/Sema/SemaTemplateInstantiate.cpp
index 568f5404dc0..ce9a0263bd5 100644
--- a/clang/lib/Sema/SemaTemplateInstantiate.cpp
+++ b/clang/lib/Sema/SemaTemplateInstantiate.cpp
@@ -2162,7 +2162,7 @@ namespace {
// The deduced type itself.
TemplateTypeParmDecl *VisitTemplateTypeParmType(
const TemplateTypeParmType *T) {
- if (!T->getDecl()->isImplicit())
+ if (!T->getDecl() || !T->getDecl()->isImplicit())
return nullptr;
return T->getDecl();
}
OpenPOWER on IntegriCloud