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 | eca5cd20a12718d24090bf5ff3b6357c88d11fa1 (patch) | |
tree | 87be2c5994f1b683a4d1bfacb6e1ba3ac5984def /clang/lib/AST/Decl.cpp | |
parent | e7bb944c85040c868b1240cf0bf9855ca4e1c8d4 (diff) | |
download | bcm5719-llvm-eca5cd20a12718d24090bf5ff3b6357c88d11fa1.tar.gz bcm5719-llvm-eca5cd20a12718d24090bf5ff3b6357c88d11fa1.zip |
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!
llvm-svn: 160157
Diffstat (limited to 'clang/lib/AST/Decl.cpp')
-rw-r--r-- | clang/lib/AST/Decl.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp index 2066a98984c..33826cbb466 100644 --- a/clang/lib/AST/Decl.cpp +++ b/clang/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. |