clang API Documentation
#include <DeclFriend.h>
Public Types | |
typedef llvm::PointerUnion < NamedDecl *, TypeSourceInfo * > | FriendUnion |
Public Member Functions | |
TypeSourceInfo * | getFriendType () const |
unsigned | getFriendTypeNumTemplateParameterLists () const |
TemplateParameterList * | getFriendTypeTemplateParameterList (unsigned N) const |
NamedDecl * | getFriendDecl () const |
SourceLocation | getFriendLoc () const |
Retrieves the location of the 'friend' keyword. | |
SourceRange | getSourceRange () const override LLVM_READONLY |
Retrieves the source range for the friend declaration. | |
bool | isUnsupportedFriend () const |
Determines if this friend kind is unsupported. | |
void | setUnsupportedFriend (bool Unsupported) |
Static Public Member Functions | |
static FriendDecl * | Create (ASTContext &C, DeclContext *DC, SourceLocation L, FriendUnion Friend_, SourceLocation FriendL, ArrayRef< TemplateParameterList * > FriendTypeTPLists=None) |
static FriendDecl * | CreateDeserialized (ASTContext &C, unsigned ID, unsigned FriendTypeNumTPLists) |
static bool | classof (const Decl *D) |
static bool | classofKind (Kind K) |
Friends | |
class | CXXRecordDecl::friend_iterator |
class | CXXRecordDecl |
class | ASTDeclReader |
class | ASTDeclWriter |
FriendDecl - Represents the declaration of a friend entity, which can be a function, a type, or a templated function or type.
template <typename T> class A { friend int foo(T); friend class B; friend T; // only in C++0x template <typename U> friend class C; template <typename U> friend A& operator+=(A&, const U&) { ... } };
The semantic context of a friend decl is its declaring class.
Definition at line 40 of file DeclFriend.h.
typedef llvm::PointerUnion<NamedDecl*,TypeSourceInfo*> clang::FriendDecl::FriendUnion |
Definition at line 43 of file DeclFriend.h.
static bool clang::FriendDecl::classof | ( | const Decl * | D | ) | [inline, static] |
Definition at line 169 of file DeclFriend.h.
References classofKind(), and clang::Decl::getKind().
static bool clang::FriendDecl::classofKind | ( | Kind | K | ) | [inline, static] |
Reimplemented from clang::Decl.
Definition at line 170 of file DeclFriend.h.
Referenced by classof().
FriendDecl * FriendDecl::Create | ( | ASTContext & | C, |
DeclContext * | DC, | ||
SourceLocation | L, | ||
FriendUnion | Friend_, | ||
SourceLocation | FriendL, | ||
ArrayRef< TemplateParameterList * > | FriendTypeTPLists = None |
||
) | [static] |
Definition at line 27 of file DeclFriend.cpp.
References AttributeLangSupport::C, clang::Decl::getFriendObjectKind(), and getTemplateSpecializationKind().
Referenced by clang::Sema::ActOnClassTemplateSpecialization(), clang::Sema::ActOnFriendFunctionDecl(), clang::Sema::ActOnTemplatedFriendTag(), clang::Sema::CheckClassTemplate(), and clang::Sema::CheckFriendTypeDecl().
FriendDecl * FriendDecl::CreateDeserialized | ( | ASTContext & | C, |
unsigned | ID, | ||
unsigned | FriendTypeNumTPLists | ||
) | [static] |
Definition at line 56 of file DeclFriend.cpp.
References AttributeLangSupport::C.
NamedDecl* clang::FriendDecl::getFriendDecl | ( | ) | const [inline] |
If this friend declaration doesn't name a type, return the inner declaration.
Definition at line 126 of file DeclFriend.h.
Referenced by getSourceRange(), MatchesFriend(), and clang::ASTDeclWriter::VisitFriendDecl().
SourceLocation clang::FriendDecl::getFriendLoc | ( | ) | const [inline] |
Retrieves the location of the 'friend' keyword.
Definition at line 131 of file DeclFriend.h.
Referenced by getSourceRange().
TypeSourceInfo* clang::FriendDecl::getFriendType | ( | ) | const [inline] |
If this friend declaration names an (untemplated but possibly dependent) type, return the type; otherwise return null. This is used for elaborated-type-specifiers and, in C++0x, for arbitrary friend type declarations.
Definition at line 113 of file DeclFriend.h.
Referenced by getSourceRange(), MatchesFriend(), and clang::ASTDeclWriter::VisitFriendDecl().
unsigned clang::FriendDecl::getFriendTypeNumTemplateParameterLists | ( | ) | const [inline] |
Definition at line 116 of file DeclFriend.h.
TemplateParameterList* clang::FriendDecl::getFriendTypeTemplateParameterList | ( | unsigned | N | ) | const [inline] |
Definition at line 119 of file DeclFriend.h.
Referenced by clang::ASTDeclWriter::VisitFriendDecl().
SourceRange clang::FriendDecl::getSourceRange | ( | ) | const [inline, override, virtual] |
Retrieves the source range for the friend declaration.
Reimplemented from clang::Decl.
Definition at line 136 of file DeclFriend.h.
References getFriendDecl(), getFriendLoc(), getFriendType(), clang::Decl::getLocation(), and clang::TemplateParameterList::getTemplateLoc().
bool clang::FriendDecl::isUnsupportedFriend | ( | ) | const [inline] |
Determines if this friend kind is unsupported.
Definition at line 161 of file DeclFriend.h.
Referenced by MatchesFriend().
void clang::FriendDecl::setUnsupportedFriend | ( | bool | Unsupported | ) | [inline] |
Definition at line 164 of file DeclFriend.h.
References clang::driver::options::Unsupported.
Referenced by clang::Sema::ActOnFriendFunctionDecl(), and clang::Sema::ActOnTemplatedFriendTag().
friend class ASTDeclReader [friend] |
Reimplemented from clang::Decl.
Definition at line 172 of file DeclFriend.h.
friend class ASTDeclWriter [friend] |
Reimplemented from clang::Decl.
Definition at line 173 of file DeclFriend.h.
friend class CXXRecordDecl [friend] |
Definition at line 74 of file DeclFriend.h.
friend class CXXRecordDecl::friend_iterator [friend] |
Definition at line 73 of file DeclFriend.h.