forked from OSchip/llvm-project
Add an ActOnFriendDecl and call it for friend class decls.
llvm-svn: 71482
This commit is contained in:
parent
22e3784c79
commit
f83c9faa2f
|
@ -933,6 +933,13 @@ public:
|
|||
return DeclPtrTy();
|
||||
}
|
||||
|
||||
/// ActOnFriendDecl - This action is called when a friend declaration is
|
||||
/// encountered. Returns false on success.
|
||||
virtual bool ActOnFriendDecl(Scope *S, SourceLocation FriendLoc,
|
||||
DeclPtrTy Dcl) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
//===------------------------- C++ Expressions --------------------------===//
|
||||
|
||||
|
|
|
@ -284,6 +284,7 @@ public:
|
|||
|
||||
bool SetFriendSpec(SourceLocation Loc, const char *&PrevSpec);
|
||||
bool isFriendSpecified() const { return Friend_specified; }
|
||||
SourceLocation getFriendSpecLoc() const { return FriendLoc; }
|
||||
|
||||
/// AddAttributes - contatenates two attribute lists.
|
||||
/// The GCC attribute syntax allows for the following:
|
||||
|
|
|
@ -525,10 +525,18 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind,
|
|||
}
|
||||
|
||||
const char *PrevSpec = 0;
|
||||
if (TagOrTempResult.isInvalid())
|
||||
if (TagOrTempResult.isInvalid()) {
|
||||
DS.SetTypeSpecError();
|
||||
else if (DS.SetTypeSpecType(TagType, StartLoc, PrevSpec,
|
||||
TagOrTempResult.get().getAs<void>()))
|
||||
return;
|
||||
}
|
||||
|
||||
if (DS.isFriendSpecified() &&
|
||||
!Actions.ActOnFriendDecl(CurScope, DS.getFriendSpecLoc(),
|
||||
TagOrTempResult.get()))
|
||||
return;
|
||||
|
||||
if (DS.SetTypeSpecType(TagType, StartLoc, PrevSpec,
|
||||
TagOrTempResult.get().getAs<void>()))
|
||||
Diag(StartLoc, diag::err_invalid_decl_spec_combination) << PrevSpec;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue