clang  3.9.0
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Friends | List of all members
clang::FriendDecl Class Referencefinal

FriendDecl - Represents the declaration of a friend entity, which can be a function, a type, or a templated function or type. More...

#include <DeclFriend.h>

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

Public Types

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

Public Member Functions

TypeSourceInfogetFriendType () const
 If this friend declaration names an (untemplated but possibly dependent) type, return the type; otherwise return null. More...
 
unsigned getFriendTypeNumTemplateParameterLists () const
 
TemplateParameterListgetFriendTypeTemplateParameterList (unsigned N) const
 
NamedDeclgetFriendDecl () const
 If this friend declaration doesn't name a type, return the inner declaration. More...
 
SourceLocation getFriendLoc () const
 Retrieves the location of the 'friend' keyword. More...
 
SourceRange getSourceRange () const override LLVM_READONLY
 Retrieves the source range for the friend declaration. More...
 
bool isUnsupportedFriend () const
 Determines if this friend kind is unsupported. More...
 
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)
 

Public Attributes

friend TrailingObjects
 

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 45 of file DeclFriend.h.

Member Function Documentation

static bool clang::FriendDecl::classof ( const Decl D)
inlinestatic

Definition at line 164 of file DeclFriend.h.

References classofKind().

static bool clang::FriendDecl::classofKind ( Kind  K)
inlinestatic

Definition at line 165 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 58 of file DeclFriend.cpp.

References AttributeLangSupport::C, and ID.

NamedDecl* clang::FriendDecl::getFriendDecl ( ) const
inline

If this friend declaration doesn't name a type, return the inner declaration.

Definition at line 120 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 125 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 107 of file DeclFriend.h.

Referenced by getSourceRange(), MatchesFriend(), and clang::ASTDeclWriter::VisitFriendDecl().

unsigned clang::FriendDecl::getFriendTypeNumTemplateParameterLists ( ) const
inline

Definition at line 110 of file DeclFriend.h.

TemplateParameterList* clang::FriendDecl::getFriendTypeTemplateParameterList ( unsigned  N) const
inline

Definition at line 113 of file DeclFriend.h.

Referenced by clang::ASTDeclWriter::VisitFriendDecl().

SourceRange clang::FriendDecl::getSourceRange ( ) const
inlineoverride

Retrieves the source range for the friend declaration.

Definition at line 130 of file DeclFriend.h.

References getFriendDecl(), getFriendLoc(), and getFriendType().

bool clang::FriendDecl::isUnsupportedFriend ( ) const
inline

Determines if this friend kind is unsupported.

Definition at line 156 of file DeclFriend.h.

Referenced by MatchesFriend().

void clang::FriendDecl::setUnsupportedFriend ( bool  Unsupported)
inline

Friends And Related Function Documentation

friend class ASTDeclReader
friend

Definition at line 167 of file DeclFriend.h.

friend class ASTDeclWriter
friend

Definition at line 168 of file DeclFriend.h.

friend class CXXRecordDecl
friend

Definition at line 68 of file DeclFriend.h.

friend class CXXRecordDecl::friend_iterator
friend

Definition at line 67 of file DeclFriend.h.

Member Data Documentation

friend clang::FriendDecl::TrailingObjects

Definition at line 169 of file DeclFriend.h.


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