aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/Decl.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2012-07-12 20:05:04 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2012-07-12 20:05:04 +0000
commit23458208b25acd7d2dfa003b029299e30124fe5f (patch)
tree48169d8787293385986aa2e8460594cfbb016196 /lib/AST/Decl.cpp
parent59d7cc9e4c376c12d4fa2c30337761dbec94e92d (diff)
Use the canonical template decl when trying to find if it has a visibility
attribute. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160139 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Decl.cpp')
-rw-r--r--lib/AST/Decl.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp
index 33826cbb46..2066a98984 100644
--- a/lib/AST/Decl.cpp
+++ b/lib/AST/Decl.cpp
@@ -702,8 +702,10 @@ 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))
- return getVisibilityOf(spec->getSpecializedTemplate()->getTemplatedDecl());
+ = dyn_cast<ClassTemplateSpecializationDecl>(this)) {
+ ClassTemplateDecl *TD = spec->getSpecializedTemplate()->getCanonicalDecl();
+ return getVisibilityOf(TD->getTemplatedDecl());
+ }
// If this is a member class of a specialization of a class template
// and the corresponding decl has explicit visibility, use that.