зеркало из https://github.com/microsoft/clang-1.git
For consistency, just make friend declarations AS_public.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80420 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
2a29c4b6ef
Коммит
5fee110ac1
|
@ -379,16 +379,8 @@ SourceLocation Decl::getBodyRBrace() const {
|
|||
|
||||
#ifndef NDEBUG
|
||||
void Decl::CheckAccessDeclContext() const {
|
||||
if (isa<TranslationUnitDecl>(this) ||
|
||||
!isa<CXXRecordDecl>(getDeclContext()))
|
||||
return;
|
||||
|
||||
// FIXME: Should friend declarations have access specifiers?
|
||||
if (isa<FriendDecl>(this) ||
|
||||
getFriendObjectKind() != FOK_None)
|
||||
return;
|
||||
|
||||
assert(Access != AS_none &&
|
||||
assert((Access != AS_none || isa<TranslationUnitDecl>(this) ||
|
||||
!isa<CXXRecordDecl>(getDeclContext())) &&
|
||||
"Access specifier is AS_none inside a record decl");
|
||||
}
|
||||
|
||||
|
|
|
@ -3661,6 +3661,7 @@ Sema::DeclPtrTy Sema::ActOnFriendTypeDecl(Scope *S,
|
|||
|
||||
FriendDecl *FD = FriendDecl::Create(Context, CurContext, Loc, FU,
|
||||
DS.getFriendSpecLoc());
|
||||
FD->setAccess(AS_public);
|
||||
CurContext->addDecl(FD);
|
||||
|
||||
return DeclPtrTy::make(FD);
|
||||
|
@ -3829,6 +3830,7 @@ Sema::DeclPtrTy Sema::ActOnFriendFunctionDecl(Scope *S,
|
|||
FriendDecl *FrD = FriendDecl::Create(Context, CurContext,
|
||||
D.getIdentifierLoc(), FD,
|
||||
DS.getFriendSpecLoc());
|
||||
FrD->setAccess(AS_public);
|
||||
CurContext->addDecl(FrD);
|
||||
|
||||
return DeclPtrTy::make(FD);
|
||||
|
|
|
@ -278,6 +278,7 @@ Decl *TemplateDeclInstantiator::VisitFriendDecl(FriendDecl *D) {
|
|||
FriendDecl *FD =
|
||||
FriendDecl::Create(SemaRef.Context, Owner, D->getLocation(), FU,
|
||||
D->getFriendLoc());
|
||||
FD->setAccess(AS_public);
|
||||
Owner->addDecl(FD);
|
||||
return FD;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче