From: Nick Lewycky Date: Thu, 12 May 2011 03:51:24 +0000 (+0000) Subject: Fix crasher spotted in IWYU. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8a29bc047a374df2464869b55581c24def68c2ec;p=clang Fix crasher spotted in IWYU. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131222 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaTemplateInstantiateDecl.cpp b/lib/Sema/SemaTemplateInstantiateDecl.cpp index 1f0bd4cac2..f6cce0bbf9 100644 --- a/lib/Sema/SemaTemplateInstantiateDecl.cpp +++ b/lib/Sema/SemaTemplateInstantiateDecl.cpp @@ -2314,7 +2314,8 @@ void Sema::InstantiateFunctionDefinition(SourceLocation PointOfInstantiation, Pattern = PatternDecl->getBody(PatternDecl); // Postpone late parsed template instantiations. - if (PatternDecl->isLateTemplateParsed() && !LateTemplateParser) { + if (PatternDecl && PatternDecl->isLateTemplateParsed() && + !LateTemplateParser) { PendingInstantiations.push_back( std::make_pair(Function, PointOfInstantiation)); return;