clang API Documentation

Public Types | Public Member Functions | Static Public Member Functions | Friends
clang::FriendDecl Class Reference

#include <DeclFriend.h>

Inheritance diagram for clang::FriendDecl:
Inheritance graph
[legend]
Collaboration diagram for clang::FriendDecl:
Collaboration graph
[legend]

List of all members.

Public Types

typedef llvm::PointerUnion
< NamedDecl *, TypeSourceInfo * > 
FriendUnion

Public Member Functions

TypeSourceInfogetFriendType () const
unsigned getFriendTypeNumTemplateParameterLists () const
TemplateParameterListgetFriendTypeTemplateParameterList (unsigned N) const
NamedDeclgetFriendDecl () 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 FriendDeclCreate (ASTContext &C, DeclContext *DC, SourceLocation L, FriendUnion Friend_, SourceLocation FriendL, ArrayRef< TemplateParameterList * > FriendTypeTPLists=None)
static FriendDeclCreateDeserialized (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

Detailed Description

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.


Member Typedef Documentation

Definition at line 43 of file DeclFriend.h.


Member Function Documentation

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]
FriendDecl * FriendDecl::CreateDeserialized ( ASTContext C,
unsigned  ID,
unsigned  FriendTypeNumTPLists 
) [static]

Definition at line 56 of file DeclFriend.cpp.

References AttributeLangSupport::C.

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().

Retrieves the location of the 'friend' keyword.

Definition at line 131 of file DeclFriend.h.

Referenced by getSourceRange().

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().

Definition at line 116 of file DeclFriend.h.

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().

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]

Friends And Related Function Documentation

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.


The documentation for this class was generated from the following files: