From 6ca07ca618af018f4ecd2321e91577dca81ba99c Mon Sep 17 00:00:00 2001 From: Nick Lewycky Date: Mon, 10 Aug 2015 21:54:08 +0000 Subject: 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 --- clang/lib/Sema/SemaTemplateInstantiateDecl.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'clang/lib/Sema') 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(VisitVarDecl(Pattern, /*InstantiatingVarTemplate=*/true)); + if (!VarInst) return nullptr; DeclContext *DC = Owner; -- cgit v1.2.3