clang API Documentation
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>
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. | |
Expr * | getBase () 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. | |
NestedNameSpecifier * | getQualifier () 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. | |
NamedDecl * | getFirstQualifierFoundInScope () 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 DeclarationNameInfo & | getMemberNameInfo () 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>. | |
ASTTemplateArgumentListInfo & | getExplicitTemplateArgs () |
Retrieve the explicit template argument list that followed the member template name, if any. | |
const ASTTemplateArgumentListInfo & | getExplicitTemplateArgs () const |
Retrieve the explicit template argument list that followed the member template name, if any. | |
const ASTTemplateArgumentListInfo * | getOptionalExplicitTemplateArgs () 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 TemplateArgumentLoc * | getTemplateArgs () 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 |
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.
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.
child_range clang::CXXDependentScopeMemberExpr::children | ( | ) | [inline] |
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().
void clang::CXXDependentScopeMemberExpr::copyTemplateArgumentsInto | ( | TemplateArgumentListInfo & | List | ) | const [inline] |
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] |
Definition at line 1251 of file ExprCXX.cpp.
References clang::ASTContext::Allocate(), clang::SourceLocation::isValid(), clang::TemplateArgumentListInfo::size(), and clang::ASTTemplateKWAndArgsInfo::sizeFor().
Referenced by clang::Sema::ActOnDependentIdExpression(), clang::Sema::ActOnDependentMemberExpr(), clang::Sema::DiagnoseEmptyLookup(), and recoverFromMSUnqualifiedLookup().
CXXDependentScopeMemberExpr * CXXDependentScopeMemberExpr::CreateEmpty | ( | const ASTContext & | C, |
bool | HasTemplateKWAndArgsInfo, | ||
unsigned | NumTemplateArgs | ||
) | [static] |
Definition at line 1280 of file ExprCXX.cpp.
References clang::ASTContext::Allocate(), AttributeLangSupport::C, and clang::ASTTemplateKWAndArgsInfo::sizeFor().
Expr* clang::CXXDependentScopeMemberExpr::getBase | ( | ) | const [inline] |
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().
QualType clang::CXXDependentScopeMemberExpr::getBaseType | ( | ) | const [inline] |
ASTTemplateArgumentListInfo& clang::CXXDependentScopeMemberExpr::getExplicitTemplateArgs | ( | ) | [inline] |
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().
const ASTTemplateArgumentListInfo& clang::CXXDependentScopeMemberExpr::getExplicitTemplateArgs | ( | ) | const [inline] |
Retrieve the explicit template argument list that followed the member template name, if any.
Definition at line 3115 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).
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 3087 of file ExprCXX.h.
References clang::ASTTemplateArgumentListInfo::LAngleLoc.
Referenced by hasExplicitTemplateArgs().
SourceLocation clang::CXXDependentScopeMemberExpr::getLocEnd | ( | ) | const [inline] |
Reimplemented from clang::Stmt.
Definition at line 3160 of file ExprCXX.h.
References clang::DeclarationNameInfo::getEndLoc(), getRAngleLoc(), and hasExplicitTemplateArgs().
SourceLocation clang::CXXDependentScopeMemberExpr::getLocStart | ( | ) | const [inline] |
Reimplemented from clang::Stmt.
Definition at line 3152 of file ExprCXX.h.
References clang::NestedNameSpecifierLoc::getBeginLoc(), clang::DeclarationNameInfo::getBeginLoc(), clang::Stmt::getLocStart(), getQualifier(), getQualifierLoc(), and isImplicitAccess().
DeclarationName clang::CXXDependentScopeMemberExpr::getMember | ( | ) | const [inline] |
Retrieve the name of the member that this expression refers to.
Definition at line 3072 of file ExprCXX.h.
References clang::DeclarationNameInfo::getName().
SourceLocation clang::CXXDependentScopeMemberExpr::getMemberLoc | ( | ) | const [inline] |
Definition at line 3076 of file ExprCXX.h.
References clang::DeclarationNameInfo::getLoc().
const DeclarationNameInfo& clang::CXXDependentScopeMemberExpr::getMemberNameInfo | ( | ) | const [inline] |
unsigned clang::CXXDependentScopeMemberExpr::getNumTemplateArgs | ( | ) | const [inline] |
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.
SourceLocation clang::CXXDependentScopeMemberExpr::getOperatorLoc | ( | ) | const [inline] |
const ASTTemplateArgumentListInfo* clang::CXXDependentScopeMemberExpr::getOptionalExplicitTemplateArgs | ( | ) | const [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 3124 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 3040 of file ExprCXX.h.
References clang::NestedNameSpecifierLoc::getNestedNameSpecifier().
Referenced by getLocStart().
NestedNameSpecifierLoc clang::CXXDependentScopeMemberExpr::getQualifierLoc | ( | ) | const [inline] |
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().
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 3094 of file ExprCXX.h.
References clang::ASTTemplateArgumentListInfo::RAngleLoc.
Referenced by getLocEnd().
const TemplateArgumentLoc* clang::CXXDependentScopeMemberExpr::getTemplateArgs | ( | ) | const [inline] |
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().
SourceLocation clang::CXXDependentScopeMemberExpr::getTemplateKeywordLoc | ( | ) | const [inline] |
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().
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 3104 of file ExprCXX.h.
References getLAngleLoc(), and clang::SourceLocation::isValid().
Referenced by getExplicitTemplateArgs(), getLocEnd(), and getOptionalExplicitTemplateArgs().
bool clang::CXXDependentScopeMemberExpr::hasTemplateKeyword | ( | ) | const [inline] |
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().
void clang::CXXDependentScopeMemberExpr::initializeTemplateArgumentsFrom | ( | const TemplateArgumentListInfo & | List | ) | [inline] |
Initializes the template arguments using the given structure.
Definition at line 3136 of file ExprCXX.h.
References getExplicitTemplateArgs(), and clang::ASTTemplateArgumentListInfo::initializeFrom().
bool clang::CXXDependentScopeMemberExpr::isArrow | ( | ) | const [inline] |
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().
friend class ASTStmtReader [friend] |
Reimplemented from clang::Stmt.
friend class ASTStmtWriter [friend] |
Reimplemented from clang::Stmt.