summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/Decl.cpp
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2014-04-29 07:32:26 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2014-04-29 07:32:26 +0000
commit35b02bc7abac9a3eef623730bb9f91270541a065 (patch)
tree11b5500567ec7f77bca43dc663c57011fdcd3649 /clang/lib/AST/Decl.cpp
parent366363dac18e471a5cc4590a95a1a125bc209b60 (diff)
downloadbcm5719-llvm-35b02bc7abac9a3eef623730bb9f91270541a065.tar.gz
bcm5719-llvm-35b02bc7abac9a3eef623730bb9f91270541a065.zip
AST: Fix visibility calculation for VarTemplateSpecializationDecl
It is possible that a variable template specialization might not have a VisibilityAttr attached to it while the template that it specializes does, in fact, have one. We should consider the template in such cases. This fixes PR19597. llvm-svn: 207498
Diffstat (limited to 'clang/lib/AST/Decl.cpp')
-rw-r--r--clang/lib/AST/Decl.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp
index ede419689fe..e33e26b5165 100644
--- a/clang/lib/AST/Decl.cpp
+++ b/clang/lib/AST/Decl.cpp
@@ -982,6 +982,10 @@ getExplicitVisibilityAux(const NamedDecl *ND,
return getVisibilityOf(InstantiatedFrom, kind);
}
+ if (const auto *VTSD = dyn_cast<VarTemplateSpecializationDecl>(Var))
+ return getVisibilityOf(VTSD->getSpecializedTemplate()->getTemplatedDecl(),
+ kind);
+
return None;
}
// Also handle function template specializations.
OpenPOWER on IntegriCloud