diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2012-07-13 01:19:08 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2012-07-13 01:19:08 +0000 |
commit | d3d02dd0ae17eabc8e0b8972ac6a3863534b39d2 (patch) | |
tree | 1078e8c7bb6724c5b7bfb45875d9715fc485526c /lib/AST/Decl.cpp | |
parent | abd56c816e9164b17bb3e7154a511b0c9896ffdb (diff) |
Fix a bug in my previous commit. The problem is not that we were not using the
canonical decl for the template, but that we were not merging attributes for
templates at all!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160157 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Decl.cpp')
-rw-r--r-- | lib/AST/Decl.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp index 2066a98984..33826cbb46 100644 --- a/lib/AST/Decl.cpp +++ b/lib/AST/Decl.cpp @@ -702,10 +702,8 @@ llvm::Optional<Visibility> NamedDecl::getExplicitVisibility() const { // specialization of a class template, check for visibility // on the pattern. if (const ClassTemplateSpecializationDecl *spec - = dyn_cast<ClassTemplateSpecializationDecl>(this)) { - ClassTemplateDecl *TD = spec->getSpecializedTemplate()->getCanonicalDecl(); - return getVisibilityOf(TD->getTemplatedDecl()); - } + = dyn_cast<ClassTemplateSpecializationDecl>(this)) + return getVisibilityOf(spec->getSpecializedTemplate()->getTemplatedDecl()); // If this is a member class of a specialization of a class template // and the corresponding decl has explicit visibility, use that. |