diff options
| author | Rafael Espindola <rafael.espindola@gmail.com> | 2012-05-21 20:31:27 +0000 |
|---|---|---|
| committer | Rafael Espindola <rafael.espindola@gmail.com> | 2012-05-21 20:31:27 +0000 |
| commit | 96dcb8d4bb88f723696dccd9aa513cd4d0e7a028 (patch) | |
| tree | 524faa8c0a85a549c0b5fde01acbd52342046351 /clang/lib | |
| parent | 93c289c28ab0117dc93f03268a82af645b29185e (diff) | |
| download | bcm5719-llvm-96dcb8d4bb88f723696dccd9aa513cd4d0e7a028.tar.gz bcm5719-llvm-96dcb8d4bb88f723696dccd9aa513cd4d0e7a028.zip | |
Function template version of the previous patch.
llvm-svn: 157207
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/AST/Decl.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp index 8bc9eb396e3..62cc62ae39e 100644 --- a/clang/lib/AST/Decl.cpp +++ b/clang/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) |

