Home | History | Annotate | Download | only in Sema

Lines Matching refs:Friend

103       // extern or friend which happens to be the canonical
190 friend struct AccessTarget;
325 DeclContext *Friend) {
326 if (Friend == Context)
329 assert(!Friend->isDependentContext() &&
335 if (Friend->isFileContext())
343 // in 'friend'.
344 static bool MightInstantiateTo(Sema &S, CanQualType Context, CanQualType Friend) {
345 if (Friend == Context)
348 if (!Friend->isDependentType() && !Context->isDependentType())
357 FunctionDecl *Friend) {
358 if (Context->getDeclName() != Friend->getDeclName())
363 Friend->getDeclContext()))
367 = S.Context.getCanonicalType(Friend->getType())
395 FunctionTemplateDecl *Friend) {
398 Friend->getTemplatedDecl());
403 const CXXRecordDecl *Friend) {
404 if (EC.includesClass(Friend))
409 = S.Context.getCanonicalType(S.Context.getTypeDeclType(Friend));
425 CanQualType Friend) {
426 if (const RecordType *RT = Friend->getAs<RecordType>())
430 if (Friend->isDependentType())
436 /// Determines whether the given friend class template matches
440 ClassTemplateDecl *Friend) {
443 // Check whether the friend is the template of a class in the
464 if (Friend == CTD->getCanonicalDecl())
473 if (CTD->getDeclName() != Friend->getDeclName())
476 // If the class's context can't instantiate to the friend's
479 Friend->getDeclContext()))
489 /// Determines whether the given friend function matches anything in
493 FunctionDecl *Friend) {
498 if (Friend == *I)
501 if (EC.isDependent() && MightInstantiateTo(S, *I, Friend))
508 /// Determines whether the given friend function template matches
512 Friend) {
528 if (Friend == FTD)
531 if (EC.isDependent() && MightInstantiateTo(S, FTD, Friend))
538 /// Determines whether the given friend declaration matches anything
543 // Whitelist accesses if there's an invalid or unsupported friend
551 NamedDecl *Friend
556 if (isa<ClassTemplateDecl>(Friend))
557 return MatchesFriend(S, EC, cast<ClassTemplateDecl>(Friend));
559 if (isa<FunctionTemplateDecl>(Friend))
560 return MatchesFriend(S, EC, cast<FunctionTemplateDecl>(Friend));
562 if (isa<CXXRecordDecl>(Friend))
563 return MatchesFriend(S, EC, cast<CXXRecordDecl>(Friend));
565 assert(isa<FunctionDecl>(Friend) && "unknown friend decl kind");
566 return MatchesFriend(S, EC, cast<FunctionDecl>(Friend));
575 for (auto *Friend : Class->friends()) {
576 switch (MatchesFriend(S, EC, Friend)) {
595 /// A helper class for checking for a friend which will grant access
684 /// Search for a class P that EC is a friend of, under the constraint
769 // granted because the reference occurs in a friend or member of
835 // access if the access occurs in a friend or member of some class P
839 // address that above. The 'friend' aspect is completely ridiculous
842 // however, we should ignore whether the naming class is a friend,
843 // and instead rely on whether any potential P is a friend.
871 /// taking friend declarations into account.
877 /// friend of class N, or
879 /// friend of class N, or in a member or friend of a class P
888 /// [B2] R occurs in a member or friend of class N, and an invented public
890 /// [B3] R occurs in a member or friend of a class P derived from N, and an
947 // Derive the friend-modified access along each path.
989 // friend-modified access.
1335 // made without data) that the friend declaration will determine
1451 // Or we might be parsing something that will turn out to be a friend:
1471 // of the declaration, just in case it's a friend of something.
1740 /// Checks access to the target of a friend declaration.