summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2015-08-10 21:54:08 +0000
committerNick Lewycky <nicholas@mxc.ca>2015-08-10 21:54:08 +0000
commit6ca07ca618af018f4ecd2321e91577dca81ba99c (patch)
tree06b24cc7a218089a84444759109c0ec85a3d551c /clang/lib/Sema
parent9dcdd2ee0370dd8d43b0a668a11721038aeaf2d4 (diff)
downloadbcm5719-llvm-6ca07ca618af018f4ecd2321e91577dca81ba99c.tar.gz
bcm5719-llvm-6ca07ca618af018f4ecd2321e91577dca81ba99c.zip
If a variable template is inside a context with template arguments that is being instantiated, and that instantiation fails, fail our instantiation instead of crashing. Errors have already been emitted.
llvm-svn: 244515
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r--clang/lib/Sema/SemaTemplateInstantiateDecl.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
index 4fa54257ee4..c8a067658bf 100644
--- a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
+++ b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
@@ -1143,6 +1143,7 @@ Decl *TemplateDeclInstantiator::VisitVarTemplateDecl(VarTemplateDecl *D) {
VarDecl *VarInst =
cast_or_null<VarDecl>(VisitVarDecl(Pattern,
/*InstantiatingVarTemplate=*/true));
+ if (!VarInst) return nullptr;
DeclContext *DC = Owner;
OpenPOWER on IntegriCloud