diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2011-05-12 03:51:24 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2011-05-12 03:51:24 +0000 |
commit | 8a29bc047a374df2464869b55581c24def68c2ec (patch) | |
tree | 78b3e13a5858858845cd4abbbc09dd3620192ea7 /lib/Sema/SemaTemplateInstantiateDecl.cpp | |
parent | ebc93e176dad36fa8a28dd3a36c5b3dc7630d87d (diff) |
Fix crasher spotted in IWYU.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131222 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplateInstantiateDecl.cpp')
-rw-r--r-- | lib/Sema/SemaTemplateInstantiateDecl.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
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; |