summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/Decl.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2012-07-13 01:19:08 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2012-07-13 01:19:08 +0000
commiteca5cd20a12718d24090bf5ff3b6357c88d11fa1 (patch)
tree87be2c5994f1b683a4d1bfacb6e1ba3ac5984def /clang/lib/AST/Decl.cpp
parente7bb944c85040c868b1240cf0bf9855ca4e1c8d4 (diff)
downloadbcm5719-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.cpp6
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.
OpenPOWER on IntegriCloud