summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
diff options
context:
space:
mode:
authorAlexis Hunt <alercah@gmail.com>2011-05-25 22:02:25 +0000
committerAlexis Hunt <alercah@gmail.com>2011-05-25 22:02:25 +0000
commit92a0adf05f029bc1efb126eb012980f44ed7de0e (patch)
treedef1ad8aecbd67ce7f1027447e4d42cf77d68c2c /clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
parent2dda91690f9f8ca6fcdf1ef2624007f1bfd64968 (diff)
downloadbcm5719-llvm-92a0adf05f029bc1efb126eb012980f44ed7de0e.tar.gz
bcm5719-llvm-92a0adf05f029bc1efb126eb012980f44ed7de0e.zip
Fix a minor thinko that leads to a crash if PatternDecl is null but
Pattern is not. Thanks Nick for catching this! llvm-svn: 132089
Diffstat (limited to 'clang/lib/Sema/SemaTemplateInstantiateDecl.cpp')
-rw-r--r--clang/lib/Sema/SemaTemplateInstantiateDecl.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
index 701493cf988..3c0d34bd0d8 100644
--- a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
+++ b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
@@ -2318,11 +2318,12 @@ void Sema::InstantiateFunctionDefinition(SourceLocation PointOfInstantiation,
// Find the function body that we'll be substituting.
const FunctionDecl *PatternDecl = Function->getTemplateInstantiationPattern();
Stmt *Pattern = 0;
- if (PatternDecl)
+ if (PatternDecl) {
Pattern = PatternDecl->getBody(PatternDecl);
- if (!Pattern)
- // Try to find a defaulted definition
- PatternDecl->isDefined(PatternDecl);
+ if (!Pattern)
+ // Try to find a defaulted definition
+ PatternDecl->isDefined(PatternDecl);
+ }
// Postpone late parsed template instantiations.
if (PatternDecl && PatternDecl->isLateTemplateParsed() &&
OpenPOWER on IntegriCloud