aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/Decl.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2012-05-21 20:31:27 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2012-05-21 20:31:27 +0000
commitcae1c623b638f91e848ed81a2510b86b403992e4 (patch)
treecd11968fe09828da9efb55c8a0085c2cf9b86904 /lib/AST/Decl.cpp
parent0b0ad0abd8518742c57d0c6fc01c79982ba2bfdf (diff)
Function template version of the previous patch.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157207 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Decl.cpp')
-rw-r--r--lib/AST/Decl.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp
index 8bc9eb396e..62cc62ae39 100644
--- a/lib/AST/Decl.cpp
+++ b/lib/AST/Decl.cpp
@@ -158,8 +158,9 @@ getLVForTemplateArgumentList(const TemplateArgumentList &TArgs,
return getLVForTemplateArgumentList(TArgs.data(), TArgs.size(), OnlyTemplate);
}
-static bool shouldConsiderTemplateLV(const FunctionDecl *fn) {
- return !fn->hasAttr<VisibilityAttr>();
+static bool shouldConsiderTemplateLV(const FunctionDecl *fn,
+ const FunctionTemplateSpecializationInfo *spec) {
+ return !fn->hasAttr<VisibilityAttr>() || spec->isExplicitSpecialization();
}
static bool shouldConsiderTemplateLV(const ClassTemplateSpecializationDecl *d) {
@@ -374,7 +375,7 @@ static LinkageInfo getLVForNamespaceScopeDecl(const NamedDecl *D,
// this is an explicit specialization with a visibility attribute.
if (FunctionTemplateSpecializationInfo *specInfo
= Function->getTemplateSpecializationInfo()) {
- if (shouldConsiderTemplateLV(Function)) {
+ if (shouldConsiderTemplateLV(Function, specInfo)) {
LV.merge(getLVForDecl(specInfo->getTemplate(),
true));
const TemplateArgumentList &templateArgs = *specInfo->TemplateArguments;
@@ -525,7 +526,7 @@ static LinkageInfo getLVForClassMember(const NamedDecl *D, bool OnlyTemplate) {
// the template parameters and arguments.
if (FunctionTemplateSpecializationInfo *spec
= MD->getTemplateSpecializationInfo()) {
- if (shouldConsiderTemplateLV(MD)) {
+ if (shouldConsiderTemplateLV(MD, spec)) {
LV.mergeWithMin(getLVForTemplateArgumentList(*spec->TemplateArguments,
OnlyTemplate));
if (!OnlyTemplate)