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 (const 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 () const
 Retrieves the optional 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.
SourceLocation getLocStart () const LLVM_READONLY
SourceLocation getLocEnd () const LLVM_READONLY
child_range children ()

Static Public Member Functions

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

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 2940 of file ExprCXX.h.


Constructor & Destructor Documentation

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

Definition at line 1230 of file ExprCXX.cpp.


Member Function Documentation

Reimplemented from clang::Stmt.

Definition at line 3171 of file ExprCXX.h.

References isImplicitAccess().

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

Reimplemented from clang::Expr.

Definition at line 3166 of file ExprCXX.h.

References clang::Stmt::getStmtClass().

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

Definition at line 3131 of file ExprCXX.h.

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

CXXDependentScopeMemberExpr * CXXDependentScopeMemberExpr::Create ( const 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 ( const ASTContext C,
bool  HasTemplateKWAndArgsInfo,
unsigned  NumTemplateArgs 
) [static]

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

Definition at line 3024 of file ExprCXX.h.

References isImplicitAccess().

Definition at line 3029 of file ExprCXX.h.

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

Definition at line 3108 of file ExprCXX.h.

References hasExplicitTemplateArgs().

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

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

Definition at line 3115 of file ExprCXX.h.

References getExplicitTemplateArgs().

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 3060 of file ExprCXX.h.

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

Definition at line 3087 of file ExprCXX.h.

References clang::ASTTemplateArgumentListInfo::LAngleLoc.

Referenced by hasExplicitTemplateArgs().

Reimplemented from clang::Stmt.

Definition at line 3160 of file ExprCXX.h.

References clang::DeclarationNameInfo::getEndLoc(), getRAngleLoc(), and hasExplicitTemplateArgs().

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

Definition at line 3072 of file ExprCXX.h.

References clang::DeclarationNameInfo::getName().

Definition at line 3076 of file ExprCXX.h.

References clang::DeclarationNameInfo::getLoc().

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

Definition at line 3066 of file ExprCXX.h.

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

Definition at line 3148 of file ExprCXX.h.

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

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

Definition at line 3036 of file ExprCXX.h.

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 3124 of file ExprCXX.h.

References getExplicitTemplateArgs(), and hasExplicitTemplateArgs().

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

Definition at line 3040 of file ExprCXX.h.

References clang::NestedNameSpecifierLoc::getNestedNameSpecifier().

Referenced by getLocStart().

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

Definition at line 3046 of file ExprCXX.h.

Referenced by getLocStart().

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

Definition at line 3094 of file ExprCXX.h.

References clang::ASTTemplateArgumentListInfo::RAngleLoc.

Referenced by getLocEnd().

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

Definition at line 3142 of file ExprCXX.h.

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

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

Definition at line 3080 of file ExprCXX.h.

References clang::ASTTemplateKWAndArgsInfo::getTemplateKeywordLoc().

Referenced by hasTemplateKeyword().

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

Definition at line 3104 of file ExprCXX.h.

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

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

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

Definition at line 3100 of file ExprCXX.h.

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

Initializes the template arguments using the given structure.

Definition at line 3136 of file ExprCXX.h.

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

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

Definition at line 3033 of file ExprCXX.h.

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 1302 of file ExprCXX.cpp.

References clang::CodeGen::Base, and clang::Expr::isImplicitCXXThis().

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


Friends And Related Function Documentation

friend class ASTStmtReader [friend]

Reimplemented from clang::Stmt.

Definition at line 3176 of file ExprCXX.h.

friend class ASTStmtWriter [friend]

Reimplemented from clang::Stmt.

Definition at line 3177 of file ExprCXX.h.


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