aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaTemplateInstantiateDecl.cpp
diff options
context:
space:
mode:
authorRichard Trieu <rtrieu@google.com>2011-05-27 02:08:53 +0000
committerRichard Trieu <rtrieu@google.com>2011-05-27 02:08:53 +0000
commit855f41963e545172a935d07b4713d079e258a207 (patch)
tree7bcdabc3c85d7ce5755bb9448d03ac48330c30e5 /lib/Sema/SemaTemplateInstantiateDecl.cpp
parente4d645cbe073042d8abc1a4eb600af4ff7a8dffb (diff)
Add an additional check for null pointer before accessing PatternDecl.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132175 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplateInstantiateDecl.cpp')
-rw-r--r--lib/Sema/SemaTemplateInstantiateDecl.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Sema/SemaTemplateInstantiateDecl.cpp b/lib/Sema/SemaTemplateInstantiateDecl.cpp
index 3c0d34bd0d..e9c09c39f3 100644
--- a/lib/Sema/SemaTemplateInstantiateDecl.cpp
+++ b/lib/Sema/SemaTemplateInstantiateDecl.cpp
@@ -2341,7 +2341,7 @@ void Sema::InstantiateFunctionDefinition(SourceLocation PointOfInstantiation,
Pattern = PatternDecl->getBody(PatternDecl);
}
- if (!Pattern && !PatternDecl->isDefaulted()) {
+ if (!Pattern && PatternDecl && !PatternDecl->isDefaulted()) {
if (DefinitionRequired) {
if (Function->getPrimaryTemplate())
Diag(PointOfInstantiation,