diff options
| author | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-08-01 04:12:04 +0000 |
|---|---|---|
| committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-08-01 04:12:04 +0000 |
| commit | b71782b7e510e6088b8970d20ebbf1bbcf662b98 (patch) | |
| tree | 0f4240cb27233818c3cf4597212f6cf98c218902 /clang/lib/AST | |
| parent | 302ae6b002522f07482697361af30890ee0af31e (diff) | |
| download | bcm5719-llvm-b71782b7e510e6088b8970d20ebbf1bbcf662b98.tar.gz bcm5719-llvm-b71782b7e510e6088b8970d20ebbf1bbcf662b98.zip | |
Fix assert when instantiating a default argument of a template defined in a
module.
llvm-svn: 187556
Diffstat (limited to 'clang/lib/AST')
| -rw-r--r-- | clang/lib/AST/Decl.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp index 4ecb41b3f0b..772f7353c36 100644 --- a/clang/lib/AST/Decl.cpp +++ b/clang/lib/AST/Decl.cpp @@ -1959,7 +1959,10 @@ TemplateSpecializationKind VarDecl::getTemplateSpecializationKind() const { } MemberSpecializationInfo *VarDecl::getMemberSpecializationInfo() const { - return getASTContext().getInstantiatedFromStaticDataMember(this); + if (isStaticDataMember()) + return getASTContext().getInstantiatedFromStaticDataMember(this); + + return 0; } void VarDecl::setTemplateSpecializationKind(TemplateSpecializationKind TSK, |

