From 08e8dd7b9db7bb4a9de26d44c1cbfd24e869c014 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Wed, 27 Jul 2022 21:50:45 +0200 Subject: Vendor import of llvm-project main llvmorg-15-init-17826-g1f8ae9d7e7e4, the last commit before the upstream release/16.x branch was created. --- clang/lib/AST/Decl.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'clang/lib/AST/Decl.cpp') diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp index f88a2e3fa268..aaba4345587b 100644 --- a/clang/lib/AST/Decl.cpp +++ b/clang/lib/AST/Decl.cpp @@ -394,7 +394,6 @@ void LinkageComputer::mergeTemplateLV( shouldConsiderTemplateVisibility(fn, specInfo); FunctionTemplateDecl *temp = specInfo->getTemplate(); - // Merge information from the template declaration. LinkageInfo tempLV = getLVForDecl(temp, computation); // The linkage of the specialization should be consistent with the @@ -468,11 +467,16 @@ void LinkageComputer::mergeTemplateLV( // Merge information from the template parameters, but ignore // visibility if we're only considering template arguments. - ClassTemplateDecl *temp = spec->getSpecializedTemplate(); - LinkageInfo tempLV = + // Merge information from the template declaration. + LinkageInfo tempLV = getLVForDecl(temp, computation); + // The linkage of the specialization should be consistent with the + // template declaration. + LV.setLinkage(tempLV.getLinkage()); + + LinkageInfo paramsLV = getLVForTemplateParameterList(temp->getTemplateParameters(), computation); - LV.mergeMaybeWithVisibility(tempLV, + LV.mergeMaybeWithVisibility(paramsLV, considerVisibility && !hasExplicitVisibilityAlready(computation)); // Merge information from the template arguments. We ignore @@ -520,7 +524,6 @@ void LinkageComputer::mergeTemplateLV(LinkageInfo &LV, // Merge information from the template parameters, but ignore // visibility if we're only considering template arguments. - VarTemplateDecl *temp = spec->getSpecializedTemplate(); LinkageInfo tempLV = getLVForTemplateParameterList(temp->getTemplateParameters(), computation); @@ -1077,7 +1080,6 @@ LinkageComputer::getLVForClassMember(const NamedDecl *D, // Finally, merge in information from the class. LV.mergeMaybeWithVisibility(classLV, considerClassVisibility); - return LV; } -- cgit v1.3