aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/Decl.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2012-07-31 19:02:02 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2012-07-31 19:02:02 +0000
commit98499013bd70ec584f4c01c45106ec3e8203f16c (patch)
tree22a238ff42fe06f8d72cf94bcea34bfb799c9026 /lib/AST/Decl.cpp
parent2f9c40a915593849f6b0f5c4de516e2f597d0d66 (diff)
Consider the visibility of template template arguments. GCC doesn't, but it also
fails to consider the linkage, which we were already considering. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161070 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Decl.cpp')
-rw-r--r--lib/AST/Decl.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp
index c98853adec..d5b0be3ba4 100644
--- a/lib/AST/Decl.cpp
+++ b/lib/AST/Decl.cpp
@@ -710,6 +710,10 @@ llvm::Optional<Visibility> NamedDecl::getExplicitVisibility() const {
if (llvm::Optional<Visibility> V = getVisibilityOf(this))
return V;
+ // The visibility of a template is stored in the templated decl.
+ if (const TemplateDecl *TD = dyn_cast<TemplateDecl>(this))
+ return getVisibilityOf(TD->getTemplatedDecl());
+
// If there wasn't explicit visibility there, and this is a
// specialization of a class template, check for visibility
// on the pattern.