diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2013-04-15 12:38:20 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2013-04-15 12:38:20 +0000 |
commit | 72fdc8947e54be1a8dd36b03e24f112aba1241e1 (patch) | |
tree | 2c1e57fc3f5e6dc2415b8bd36e8eecdd23e9ef20 /lib/AST | |
parent | cef64fe34e679c7ef773b36731b560c8c39a3f98 (diff) |
Fix the storage class of method instantiations.
We keep the "as written" storage class, but that is a fuzzy concept for
instantiations. With this patch instantiations of methods of class templates
now get a storage class that is based on the semantics of isStatic(). With this
can simplify isStatic() itself.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179521 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST')
-rw-r--r-- | lib/AST/DeclCXX.cpp | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/lib/AST/DeclCXX.cpp b/lib/AST/DeclCXX.cpp index c8a203acb6..2c7c4d335d 100644 --- a/lib/AST/DeclCXX.cpp +++ b/lib/AST/DeclCXX.cpp @@ -1258,20 +1258,7 @@ bool CXXRecordDecl::mayBeAbstract() const { void CXXMethodDecl::anchor() { } bool CXXMethodDecl::isStatic() const { - const CXXMethodDecl *MD = this; - for (;;) { - const CXXMethodDecl *C = MD->getCanonicalDecl(); - if (C != MD) { - MD = C; - continue; - } - - FunctionTemplateSpecializationInfo *Info = - MD->getTemplateSpecializationInfo(); - if (!Info) - break; - MD = cast<CXXMethodDecl>(Info->getTemplate()->getTemplatedDecl()); - } + const CXXMethodDecl *MD = getCanonicalDecl(); if (MD->getStorageClass() == SC_Static) return true; |