Lines Matching defs:Friend
176 friend struct AccessTarget;
302 DeclContext *Friend) {
303 if (Friend == Context)
306 assert(!Friend->isDependentContext() &&
312 if (Friend->isFileContext())
320 // in 'friend'.
321 static bool MightInstantiateTo(Sema &S, CanQualType Context, CanQualType Friend) {
322 if (Friend == Context)
325 if (!Friend->isDependentType() && !Context->isDependentType())
334 FunctionDecl *Friend) {
335 if (Context->getDeclName() != Friend->getDeclName())
340 Friend->getDeclContext()))
344 = S.Context.getCanonicalType(Friend->getType())
374 FunctionTemplateDecl *Friend) {
377 Friend->getTemplatedDecl());
382 const CXXRecordDecl *Friend) {
383 if (EC.includesClass(Friend))
388 = S.Context.getCanonicalType(S.Context.getTypeDeclType(Friend));
404 CanQualType Friend) {
405 if (const RecordType *RT = Friend->getAs<RecordType>())
409 if (Friend->isDependentType())
415 /// Determines whether the given friend class template matches
419 ClassTemplateDecl *Friend) {
422 // Check whether the friend is the template of a class in the
443 if (Friend == CTD->getCanonicalDecl())
452 if (CTD->getDeclName() != Friend->getDeclName())
455 // If the class's context can't instantiate to the friend's
458 Friend->getDeclContext()))
468 /// Determines whether the given friend function matches anything in
472 FunctionDecl *Friend) {
477 if (Friend == *I)
480 if (EC.isDependent() && MightInstantiateTo(S, *I, Friend))
487 /// Determines whether the given friend function template matches
491 FunctionTemplateDecl *Friend) {
507 if (Friend == FTD)
510 if (EC.isDependent() && MightInstantiateTo(S, FTD, Friend))
517 /// Determines whether the given friend declaration matches anything
522 friend
530 NamedDecl *Friend
535 if (isa<ClassTemplateDecl>(Friend))
536 return MatchesFriend(S, EC, cast<ClassTemplateDecl>(Friend));
538 if (isa<FunctionTemplateDecl>(Friend))
539 return MatchesFriend(S, EC, cast<FunctionTemplateDecl>(Friend));
541 if (isa<CXXRecordDecl>(Friend))
542 return MatchesFriend(S, EC, cast<CXXRecordDecl>(Friend));
544 assert(isa<FunctionDecl>(Friend) && "unknown friend decl kind");
545 return MatchesFriend(S, EC, cast<FunctionDecl>(Friend));
556 FriendDecl *Friend = *I;
558 switch (MatchesFriend(S, EC, Friend)) {
577 /// A helper class for checking for a friend which will grant access
668 /// Search for a class P that EC is a friend of, under the constraint
749 // granted because the reference occurs in a friend or member of
767 // access if the access occurs in a friend or member of some class P
771 // address that above. The 'friend' aspect is completely ridiculous
774 // however, we should ignore whether the naming class is a friend,
775 // and instead rely on whether any potential P is a friend.
799 /// taking friend declarations into account.
805 /// friend of class N, or
807 /// friend of class N, or in a member or friend of a class P
816 /// [B2] R occurs in a member or friend of class N, and an invented public
818 /// [B3] R occurs in a member or friend of a class P derived from N, and an
875 // Derive the friend-modified access along each path.
917 // friend-modified access.
1080 // If this is public inheritance, or the derived class is a friend,
1199 // made without data) that the friend declaration will determine
1316 // Or we might be parsing something that will turn out to be a friend:
1337 // of the declaration, just in case it's a friend of something.