From: Sean Hunt Date: Thu, 21 Jul 2011 00:59:23 +0000 (+0000) Subject: When copping out on a friend template declaration, be sure to mark its X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=98c6bda3be11b78a10026f142a399aa1918900f2;p=clang When copping out on a friend template declaration, be sure to mark its access specifier as public. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135649 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp index 9ad9a2f0f0..0328045145 100644 --- a/lib/Sema/SemaDeclCXX.cpp +++ b/lib/Sema/SemaDeclCXX.cpp @@ -8263,11 +8263,13 @@ Decl *Sema::ActOnTemplatedFriendTag(Scope *S, SourceLocation FriendLoc, if (Invalid) return 0; - return CheckClassTemplate(S, TagSpec, TUK_Friend, TagLoc, - SS, Name, NameLoc, Attr, - TemplateParams, AS_public, - TempParamLists.size() - 1, + Decl * Result = CheckClassTemplate(S, TagSpec, TUK_Friend, TagLoc, + SS, Name, NameLoc, Attr, + TemplateParams, AS_public, + TempParamLists.size() - 1, (TemplateParameterList**) TempParamLists.release()).take(); + Result->setAccess(AS_public); + return Result; } else { // The "template<>" header is extraneous. Diag(TemplateParams->getTemplateLoc(), diag::err_template_tag_noparams)