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 --------------------------===//
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:
}
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;
}