diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-10-27 18:42:08 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-10-27 18:42:08 +0000 |
commit | 0d03514da06dffb39a260a1228ea3fd01d196fa4 (patch) | |
tree | 32e1a998727fc763ea7fcfec36946da6d3a1e88c /lib/AST/Decl.cpp | |
parent | 6c813e1cb719a328f01619c3d44910be4e79e4d5 (diff) |
An explicit instantiation definition only instantiations those class
members that have a definition. Also, use
CheckSpecializationInstantiationRedecl as part of this instantiation
to make sure that we diagnose the various kinds of problems that can
occur with explicit instantiations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85270 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Decl.cpp')
-rw-r--r-- | lib/AST/Decl.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp index 903d9438ac..38eb3371fe 100644 --- a/lib/AST/Decl.cpp +++ b/lib/AST/Decl.cpp @@ -383,6 +383,19 @@ bool VarDecl::isOutOfLine() const { return false; } +VarDecl *VarDecl::getOutOfLineDefinition() { + if (!isStaticDataMember()) + return 0; + + for (VarDecl::redecl_iterator RD = redecls_begin(), RDEnd = redecls_end(); + RD != RDEnd; ++RD) { + if (RD->getLexicalDeclContext()->isFileContext()) + return *RD; + } + + return 0; +} + VarDecl *VarDecl::getInstantiatedFromStaticDataMember() const { if (MemberSpecializationInfo *MSI = getMemberSpecializationInfo()) return cast<VarDecl>(MSI->getInstantiatedFrom()); |