summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2011-05-12 03:51:24 +0000
committerNick Lewycky <nicholas@mxc.ca>2011-05-12 03:51:24 +0000
commit610128eba61185588883becd4b0ea6577f588469 (patch)
tree6886752126f5d1d751000d2d84906d65209369e9 /clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
parentfdeb15635b5974fd1d286448d25346297403a9e9 (diff)
downloadbcm5719-llvm-610128eba61185588883becd4b0ea6577f588469.tar.gz
bcm5719-llvm-610128eba61185588883becd4b0ea6577f588469.zip
Fix crasher spotted in IWYU.
llvm-svn: 131222
Diffstat (limited to 'clang/lib/Sema/SemaTemplateInstantiateDecl.cpp')
-rw-r--r--clang/lib/Sema/SemaTemplateInstantiateDecl.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
index 1f0bd4cac21..f6cce0bbf9c 100644
--- a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
+++ b/clang/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;
OpenPOWER on IntegriCloud