Lines Matching defs:Friend
1 //===-- DeclFriend.h - Classes for C++ friend declarations -*- C++ -*------===//
10 // This file defines the section of the AST representing C++ friend
24 /// FriendDecl - Represents the declaration of a friend entity,
30 /// friend int foo(T);
31 /// friend class B;
32 /// friend T; // only in C++0x
33 /// template <typename U> friend class C;
34 /// template <typename U> friend A& operator+=(A&, const U&) { ... }
38 /// The semantic context of a friend decl is its declaring class.
45 // The declaration that's a friend of this class.
46 FriendUnion Friend;
48 // A pointer to the next friend in the sequence.
51 // Location of the 'friend' specifier.
54 /// True if this 'friend' declaration is unsupported. Eventually we
55 /// will support every possible friend declaration, but for now we
60 // (currently unsupported) friend type declarations, such as
61 // template <class T> friend class A<T>::B;
64 // The tail-allocated friend type template parameter lists (if any).
72 friend class CXXRecordDecl::friend_iterator;
73 friend class CXXRecordDecl;
75 FriendDecl(DeclContext *DC, SourceLocation L, FriendUnion Friend,
78 : Decl(Decl::Friend, DC, L),
79 Friend(Friend),
89 : Decl(Decl::Friend, Empty), NextFriend(),
108 /// If this friend declaration names an (untemplated but possibly
111 /// arbitrary friend type declarations.
113 return Friend.dyn_cast<TypeSourceInfo*>();
123 /// If this friend declaration doesn't name a type, return the inner
126 return Friend.dyn_cast<NamedDecl*>();
129 /// Retrieves the location of the 'friend' keyword.
134 /// Retrieves the source range for the friend declaration.
155 /// Determines if this friend kind is unsupported.
165 static bool classofKind(Kind K) { return K == Decl::Friend; }
167 friend class ASTDeclReader;
168 friend class ASTDeclWriter;
171 /// An iterator over the friend declarations of a class.
175 friend class CXXRecordDecl;
189 assert(Ptr && "attempt to increment past end of friend list");
231 assert(FD->NextFriend == 0 && "friend already has next friend?");