Home | History | Annotate | Download | only in Sema

Lines Matching refs:Friend

183     friend struct AccessTarget;
311 DeclContext *Friend) {
312 if (Friend == Context)
315 assert(!Friend->isDependentContext() &&
321 if (Friend->isFileContext())
329 // in 'friend'.
330 static bool MightInstantiateTo(Sema &S, CanQualType Context, CanQualType Friend) {
331 if (Friend == Context)
334 if (!Friend->isDependentType() && !Context->isDependentType())
343 FunctionDecl *Friend) {
344 if (Context->getDeclName() != Friend->getDeclName())
349 Friend->getDeclContext()))
353 = S.Context.getCanonicalType(Friend->getType())
383 FunctionTemplateDecl *Friend) {
386 Friend->getTemplatedDecl());
391 const CXXRecordDecl *Friend) {
392 if (EC.includesClass(Friend))
397 = S.Context.getCanonicalType(S.Context.getTypeDeclType(Friend));
413 CanQualType Friend) {
414 if (const RecordType *RT = Friend->getAs<RecordType>())
418 if (Friend->isDependentType())
424 /// Determines whether the given friend class template matches
428 ClassTemplateDecl *Friend) {
431 // Check whether the friend is the template of a class in the
452 if (Friend == CTD->getCanonicalDecl())
461 if (CTD->getDeclName() != Friend->getDeclName())
464 // If the class's context can't instantiate to the friend's
467 Friend->getDeclContext()))
477 /// Determines whether the given friend function matches anything in
481 FunctionDecl *Friend) {
486 if (Friend == *I)
489 if (EC.isDependent() && MightInstantiateTo(S, *I, Friend))
496 /// Determines whether the given friend function template matches
500 FunctionTemplateDecl *Friend) {
516 if (Friend == FTD)
519 if (EC.isDependent() && MightInstantiateTo(S, FTD, Friend))
526 /// Determines whether the given friend
531 // Whitelist accesses if there's an invalid or unsupported friend
539 NamedDecl *Friend
544 if (isa<ClassTemplateDecl>(Friend))
545 return MatchesFriend(S, EC, cast<ClassTemplateDecl>(Friend));
547 if (isa<FunctionTemplateDecl>(Friend))
548 return MatchesFriend(S, EC, cast<FunctionTemplateDecl>(Friend));
550 if (isa<CXXRecordDecl>(Friend))
551 return MatchesFriend(S, EC, cast<CXXRecordDecl>(Friend));
553 assert(isa<FunctionDecl>(Friend) && "unknown friend decl kind");
554 return MatchesFriend(S, EC, cast<FunctionDecl>(Friend));
565 FriendDecl *Friend = *I;
567 switch (MatchesFriend(S, EC, Friend)) {
586 /// A helper class for checking for a friend which will grant access
677 /// Search for a class P that EC is a friend of, under the constraint
762 // granted because the reference occurs in a friend or member of
828 // access if the access occurs in a friend or member of some class P
832 // address that above. The 'friend' aspect is completely ridiculous
835 // however, we should ignore whether the naming class is a friend,
836 // and instead rely on whether any potential P is a friend.
864 /// taking friend declarations into account.
870 /// friend of class N, or
872 /// friend of class N, or in a member or friend of a class P
881 /// [B2] R occurs in a member or friend of class N, and an invented public
883 /// [B3] R occurs in a member or friend of a class P derived from N, and an
940 // Derive the friend-modified access along each path.
982 // friend-modified access.
1170 // If this is public inheritance, or the derived class is a friend,
1289 // made without data) that the friend declaration will determine
1405 // Or we might be parsing something that will turn out to be a friend:
1425 // of the declaration, just in case it's a friend of something.