clang API Documentation

Public Member Functions | Static Public Member Functions | Friends
clang::CXXDependentScopeMemberExpr Class Reference

Represents a C++ member access expression where the actual member referenced could not be resolved because the base expression or the member name was dependent. More...

#include <ExprCXX.h>

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

List of all members.

Public Member Functions

 CXXDependentScopeMemberExpr (ASTContext &C, Expr *Base, QualType BaseType, bool IsArrow, SourceLocation OperatorLoc, NestedNameSpecifierLoc QualifierLoc, NamedDecl *FirstQualifierFoundInScope, DeclarationNameInfo MemberNameInfo)
bool isImplicitAccess () const
 True if this is an implicit access, i.e. one in which the member being accessed was not written in the source. The source location of the operator is invalid in this case.
ExprgetBase () const
 Retrieve the base object of this member expressions, e.g., the x in x.m.
QualType getBaseType () const
bool isArrow () const
 Determine whether this member expression used the '->' operator; otherwise, it used the '.' operator.
SourceLocation getOperatorLoc () const
 Retrieve the location of the '->' or '.' operator.
NestedNameSpecifiergetQualifier () const
 Retrieve the nested-name-specifier that qualifies the member name.
NestedNameSpecifierLoc getQualifierLoc () const
 Retrieve the nested-name-specifier that qualifies the member name, with source location information.
NamedDeclgetFirstQualifierFoundInScope () const
 Retrieve the first part of the nested-name-specifier that was found in the scope of the member access expression when the member access was initially parsed.
const DeclarationNameInfogetMemberNameInfo () const
 Retrieve the name of the member that this expression refers to.
DeclarationName getMember () const
 Retrieve the name of the member that this expression refers to.
SourceLocation getMemberLoc () const
SourceLocation getTemplateKeywordLoc () const
 Retrieve the location of the template keyword preceding the member name, if any.
SourceLocation getLAngleLoc () const
 Retrieve the location of the left angle bracket starting the explicit template argument list following the member name, if any.
SourceLocation getRAngleLoc () const
 Retrieve the location of the right angle bracket ending the explicit template argument list following the member name, if any.
bool hasTemplateKeyword () const
 Determines whether the member name was preceded by the template keyword.
bool hasExplicitTemplateArgs () const
 Determines whether this member expression actually had a C++ template argument list explicitly specified, e.g., x.f<int>.
ASTTemplateArgumentListInfogetExplicitTemplateArgs ()
 Retrieve the explicit template argument list that followed the member template name, if any.
const ASTTemplateArgumentListInfogetExplicitTemplateArgs () const
 Retrieve the explicit template argument list that followed the member template name, if any.
const ASTTemplateArgumentListInfogetOptionalExplicitTemplateArgs ()
 Retrieves the optional explicit template arguments. This points to the same data as getExplicitTemplateArgs(), but returns null if there are no explicit template arguments.
void copyTemplateArgumentsInto (TemplateArgumentListInfo &List) const
 Copies the template arguments (if present) into the given structure.
void initializeTemplateArgumentsFrom (const TemplateArgumentListInfo &List)
 Initializes the template arguments using the given structure.
const TemplateArgumentLocgetTemplateArgs () const
 Retrieve the template arguments provided as part of this template-id.
unsigned getNumTemplateArgs () const
 Retrieve the number of template arguments provided as part of this template-id.
SourceRange getSourceRange () const LLVM_READONLY
child_range children ()

Static Public Member Functions

static
CXXDependentScopeMemberExpr
Create (ASTContext &C, Expr *Base, QualType BaseType, bool IsArrow, SourceLocation OperatorLoc, NestedNameSpecifierLoc QualifierLoc, SourceLocation TemplateKWLoc, NamedDecl *FirstQualifierFoundInScope, DeclarationNameInfo MemberNameInfo, const TemplateArgumentListInfo *TemplateArgs)
static
CXXDependentScopeMemberExpr
CreateEmpty (ASTContext &C, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs)
static bool classof (const Stmt *T)
static bool classof (const CXXDependentScopeMemberExpr *)

Friends

class ASTStmtReader
class ASTStmtWriter

Detailed Description

Represents a C++ member access expression where the actual member referenced could not be resolved because the base expression or the member name was dependent.

Like UnresolvedMemberExprs, these can be either implicit or explicit accesses. It is only possible to get one of these with an implicit access if a qualifier is provided.

Definition at line 2884 of file ExprCXX.h.


Constructor & Destructor Documentation

CXXDependentScopeMemberExpr::CXXDependentScopeMemberExpr ( ASTContext C,
Expr Base,
QualType  BaseType,
bool  IsArrow,
SourceLocation  OperatorLoc,
NestedNameSpecifierLoc  QualifierLoc,
NamedDecl FirstQualifierFoundInScope,
DeclarationNameInfo  MemberNameInfo 
)

Definition at line 1067 of file ExprCXX.cpp.


Member Function Documentation

child_range clang::CXXDependentScopeMemberExpr::children ( ) [inline]

Reimplemented from clang::Stmt.

Definition at line 3120 of file ExprCXX.h.

References isImplicitAccess().

static bool clang::CXXDependentScopeMemberExpr::classof ( const Stmt T) [inline, static]

Reimplemented from clang::Expr.

Definition at line 3114 of file ExprCXX.h.

References clang::Stmt::getStmtClass().

static bool clang::CXXDependentScopeMemberExpr::classof ( const CXXDependentScopeMemberExpr ) [inline, static]

Definition at line 3117 of file ExprCXX.h.

void clang::CXXDependentScopeMemberExpr::copyTemplateArgumentsInto ( TemplateArgumentListInfo List) const [inline]

Copies the template arguments (if present) into the given structure.

Definition at line 3077 of file ExprCXX.h.

References clang::ASTTemplateArgumentListInfo::copyInto(), and getExplicitTemplateArgs().

CXXDependentScopeMemberExpr * CXXDependentScopeMemberExpr::Create ( ASTContext C,
Expr Base,
QualType  BaseType,
bool  IsArrow,
SourceLocation  OperatorLoc,
NestedNameSpecifierLoc  QualifierLoc,
SourceLocation  TemplateKWLoc,
NamedDecl FirstQualifierFoundInScope,
DeclarationNameInfo  MemberNameInfo,
const TemplateArgumentListInfo TemplateArgs 
) [static]
CXXDependentScopeMemberExpr * CXXDependentScopeMemberExpr::CreateEmpty ( ASTContext C,
bool  HasTemplateKWAndArgsInfo,
unsigned  NumTemplateArgs 
) [static]
Expr* clang::CXXDependentScopeMemberExpr::getBase ( ) const [inline]

Retrieve the base object of this member expressions, e.g., the x in x.m.

Definition at line 2971 of file ExprCXX.h.

References isImplicitAccess().

QualType clang::CXXDependentScopeMemberExpr::getBaseType ( ) const [inline]

Definition at line 2976 of file ExprCXX.h.

ASTTemplateArgumentListInfo& clang::CXXDependentScopeMemberExpr::getExplicitTemplateArgs ( ) [inline]

Retrieve the explicit template argument list that followed the member template name, if any.

Definition at line 3055 of file ExprCXX.h.

References hasExplicitTemplateArgs().

Referenced by copyTemplateArgumentsInto(), getExplicitTemplateArgs(), getNumTemplateArgs(), getOptionalExplicitTemplateArgs(), getTemplateArgs(), and initializeTemplateArgumentsFrom().

const ASTTemplateArgumentListInfo& clang::CXXDependentScopeMemberExpr::getExplicitTemplateArgs ( ) const [inline]

Retrieve the explicit template argument list that followed the member template name, if any.

Definition at line 3062 of file ExprCXX.h.

References getExplicitTemplateArgs().

NamedDecl* clang::CXXDependentScopeMemberExpr::getFirstQualifierFoundInScope ( ) const [inline]

Retrieve the first part of the nested-name-specifier that was found in the scope of the member access expression when the member access was initially parsed.

This function only returns a useful result when member access expression uses a qualified member name, e.g., "x.Base::f". Here, the declaration returned by this function describes what was found by unqualified name lookup for the identifier "Base" within the scope of the member access expression itself. At template instantiation time, this information is combined with the results of name lookup into the type of the object expression itself (the class type of x).

Definition at line 3007 of file ExprCXX.h.

SourceLocation clang::CXXDependentScopeMemberExpr::getLAngleLoc ( ) const [inline]

Retrieve the location of the left angle bracket starting the explicit template argument list following the member name, if any.

Definition at line 3034 of file ExprCXX.h.

References clang::ASTTemplateArgumentListInfo::LAngleLoc.

Referenced by hasExplicitTemplateArgs().

DeclarationName clang::CXXDependentScopeMemberExpr::getMember ( ) const [inline]

Retrieve the name of the member that this expression refers to.

Definition at line 3019 of file ExprCXX.h.

References clang::DeclarationNameInfo::getName().

SourceLocation clang::CXXDependentScopeMemberExpr::getMemberLoc ( ) const [inline]

Definition at line 3023 of file ExprCXX.h.

References clang::DeclarationNameInfo::getLoc().

const DeclarationNameInfo& clang::CXXDependentScopeMemberExpr::getMemberNameInfo ( ) const [inline]

Retrieve the name of the member that this expression refers to.

Definition at line 3013 of file ExprCXX.h.

unsigned clang::CXXDependentScopeMemberExpr::getNumTemplateArgs ( ) const [inline]

Retrieve the number of template arguments provided as part of this template-id.

Definition at line 3094 of file ExprCXX.h.

References getExplicitTemplateArgs(), and clang::ASTTemplateArgumentListInfo::NumTemplateArgs.

SourceLocation clang::CXXDependentScopeMemberExpr::getOperatorLoc ( ) const [inline]

Retrieve the location of the '->' or '.' operator.

Definition at line 2983 of file ExprCXX.h.

const ASTTemplateArgumentListInfo* clang::CXXDependentScopeMemberExpr::getOptionalExplicitTemplateArgs ( ) [inline]

Retrieves the optional explicit template arguments. This points to the same data as getExplicitTemplateArgs(), but returns null if there are no explicit template arguments.

Definition at line 3070 of file ExprCXX.h.

References getExplicitTemplateArgs(), and hasExplicitTemplateArgs().

NestedNameSpecifier* clang::CXXDependentScopeMemberExpr::getQualifier ( ) const [inline]

Retrieve the nested-name-specifier that qualifies the member name.

Definition at line 2987 of file ExprCXX.h.

References clang::NestedNameSpecifierLoc::getNestedNameSpecifier().

Referenced by getSourceRange().

NestedNameSpecifierLoc clang::CXXDependentScopeMemberExpr::getQualifierLoc ( ) const [inline]

Retrieve the nested-name-specifier that qualifies the member name, with source location information.

Definition at line 2993 of file ExprCXX.h.

Referenced by getSourceRange().

SourceLocation clang::CXXDependentScopeMemberExpr::getRAngleLoc ( ) const [inline]

Retrieve the location of the right angle bracket ending the explicit template argument list following the member name, if any.

Definition at line 3041 of file ExprCXX.h.

References clang::ASTTemplateArgumentListInfo::RAngleLoc.

Referenced by getSourceRange().

SourceRange clang::CXXDependentScopeMemberExpr::getSourceRange ( ) const [inline]

SourceLocation tokens are not useful in isolation - they are low level value objects created/interpreted by SourceManager. We assume AST clients will have a pointer to the respective SourceManager.

Reimplemented from clang::Stmt.

Definition at line 3098 of file ExprCXX.h.

References clang::SourceRange::getBegin(), clang::DeclarationNameInfo::getBeginLoc(), clang::DeclarationNameInfo::getEndLoc(), getQualifier(), getQualifierLoc(), getRAngleLoc(), clang::Stmt::getSourceRange(), hasExplicitTemplateArgs(), isImplicitAccess(), clang::SourceRange::setBegin(), and clang::SourceRange::setEnd().

const TemplateArgumentLoc* clang::CXXDependentScopeMemberExpr::getTemplateArgs ( ) const [inline]

Retrieve the template arguments provided as part of this template-id.

Definition at line 3088 of file ExprCXX.h.

References getExplicitTemplateArgs(), and clang::ASTTemplateArgumentListInfo::getTemplateArgs().

SourceLocation clang::CXXDependentScopeMemberExpr::getTemplateKeywordLoc ( ) const [inline]

Retrieve the location of the template keyword preceding the member name, if any.

Definition at line 3027 of file ExprCXX.h.

References clang::ASTTemplateKWAndArgsInfo::getTemplateKeywordLoc().

Referenced by hasTemplateKeyword().

bool clang::CXXDependentScopeMemberExpr::hasExplicitTemplateArgs ( ) const [inline]

Determines whether this member expression actually had a C++ template argument list explicitly specified, e.g., x.f<int>.

Definition at line 3051 of file ExprCXX.h.

References getLAngleLoc(), and clang::SourceLocation::isValid().

Referenced by getExplicitTemplateArgs(), getOptionalExplicitTemplateArgs(), and getSourceRange().

bool clang::CXXDependentScopeMemberExpr::hasTemplateKeyword ( ) const [inline]

Determines whether the member name was preceded by the template keyword.

Definition at line 3047 of file ExprCXX.h.

References getTemplateKeywordLoc(), and clang::SourceLocation::isValid().

void clang::CXXDependentScopeMemberExpr::initializeTemplateArgumentsFrom ( const TemplateArgumentListInfo List) [inline]

Initializes the template arguments using the given structure.

Definition at line 3082 of file ExprCXX.h.

References getExplicitTemplateArgs(), and clang::ASTTemplateArgumentListInfo::initializeFrom().

bool clang::CXXDependentScopeMemberExpr::isArrow ( ) const [inline]

Determine whether this member expression used the '->' operator; otherwise, it used the '.' operator.

Definition at line 2980 of file ExprCXX.h.

bool CXXDependentScopeMemberExpr::isImplicitAccess ( ) const

True if this is an implicit access, i.e. one in which the member being accessed was not written in the source. The source location of the operator is invalid in this case.

Definition at line 1139 of file ExprCXX.cpp.

References clang::Expr::isImplicitCXXThis().

Referenced by children(), getBase(), and getSourceRange().


Friends And Related Function Documentation

friend class ASTStmtReader [friend]

Reimplemented from clang::Stmt.

Definition at line 3125 of file ExprCXX.h.

friend class ASTStmtWriter [friend]

Reimplemented from clang::Stmt.

Definition at line 3126 of file ExprCXX.h.


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