clang API Documentation
Represents a C++ member access expression for which lookup produced a set of overloaded functions. More...
#include <ExprCXX.h>
Public Member Functions | |
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. | |
Expr * | getBase () |
Retrieve the base object of this member expressions, e.g., the x in x.m . | |
const Expr * | getBase () const |
QualType | getBaseType () const |
bool | hasUnresolvedUsing () const |
Determine whether the lookup results contain an unresolved using declaration. | |
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. | |
CXXRecordDecl * | getNamingClass () const |
Retrieve the naming class of this lookup. | |
const DeclarationNameInfo & | getMemberNameInfo () const |
Retrieve the full name info for the member that this expression refers to. | |
DeclarationName | getMemberName () const |
Retrieve the name of the member that this expression refers to. | |
SourceLocation | getMemberLoc () const |
SourceLocation | getExprLoc () const LLVM_READONLY |
SourceLocation | getLocStart () const LLVM_READONLY |
SourceLocation | getLocEnd () const LLVM_READONLY |
child_range | children () |
Static Public Member Functions | |
static UnresolvedMemberExpr * | Create (const ASTContext &C, bool HasUnresolvedUsing, Expr *Base, QualType BaseType, bool IsArrow, SourceLocation OperatorLoc, NestedNameSpecifierLoc QualifierLoc, SourceLocation TemplateKWLoc, const DeclarationNameInfo &MemberNameInfo, const TemplateArgumentListInfo *TemplateArgs, UnresolvedSetIterator Begin, UnresolvedSetIterator End) |
static UnresolvedMemberExpr * | CreateEmpty (const ASTContext &C, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs) |
static bool | classof (const Stmt *T) |
Friends | |
class | ASTStmtReader |
Represents a C++ member access expression for which lookup produced a set of overloaded functions.
The member access may be explicit or implicit:
struct A { int a, b; int explicitAccess() { return this->a + this->A::b; } int implicitAccess() { return a + A::b; } };
In the final AST, an explicit access always becomes a MemberExpr. An implicit access may become either a MemberExpr or a DeclRefExpr, depending on whether the member is static.
child_range clang::UnresolvedMemberExpr::children | ( | ) | [inline] |
Reimplemented from clang::Stmt.
Definition at line 3313 of file ExprCXX.h.
References isImplicitAccess().
static bool clang::UnresolvedMemberExpr::classof | ( | const Stmt * | T | ) | [inline, static] |
Reimplemented from clang::OverloadExpr.
Definition at line 3308 of file ExprCXX.h.
References clang::Stmt::getStmtClass().
UnresolvedMemberExpr * UnresolvedMemberExpr::Create | ( | const ASTContext & | C, |
bool | HasUnresolvedUsing, | ||
Expr * | Base, | ||
QualType | BaseType, | ||
bool | IsArrow, | ||
SourceLocation | OperatorLoc, | ||
NestedNameSpecifierLoc | QualifierLoc, | ||
SourceLocation | TemplateKWLoc, | ||
const DeclarationNameInfo & | MemberNameInfo, | ||
const TemplateArgumentListInfo * | TemplateArgs, | ||
UnresolvedSetIterator | Begin, | ||
UnresolvedSetIterator | End | ||
) | [static] |
Definition at line 1364 of file ExprCXX.cpp.
References clang::ASTContext::Allocate(), clang::SourceLocation::isValid(), clang::TemplateArgumentListInfo::size(), and clang::ASTTemplateKWAndArgsInfo::sizeFor().
Referenced by clang::Sema::BuildMemberReferenceExpr().
UnresolvedMemberExpr * UnresolvedMemberExpr::CreateEmpty | ( | const ASTContext & | C, |
bool | HasTemplateKWAndArgsInfo, | ||
unsigned | NumTemplateArgs | ||
) | [static] |
Definition at line 1387 of file ExprCXX.cpp.
References clang::ASTContext::Allocate(), clang::OverloadExpr::HasTemplateKWAndArgsInfo, and clang::ASTTemplateKWAndArgsInfo::sizeFor().
Expr* clang::UnresolvedMemberExpr::getBase | ( | ) | [inline] |
Retrieve the base object of this member expressions, e.g., the x
in x.m
.
Definition at line 3254 of file ExprCXX.h.
References clang::CodeGen::Base, and isImplicitAccess().
Referenced by clang::Sema::BuildCallToMemberFunction().
const Expr* clang::UnresolvedMemberExpr::getBase | ( | ) | const [inline] |
Definition at line 3258 of file ExprCXX.h.
References clang::CodeGen::Base, and isImplicitAccess().
QualType clang::UnresolvedMemberExpr::getBaseType | ( | ) | const [inline] |
Definition at line 3263 of file ExprCXX.h.
Referenced by clang::Sema::BuildCallToMemberFunction(), clang::Sema::CheckUnresolvedMemberAccess(), and getNamingClass().
SourceLocation clang::UnresolvedMemberExpr::getExprLoc | ( | ) | const [inline] |
getExprLoc - Return the preferred location for the arrow when diagnosing a problem with a generic expression.
Reimplemented from clang::Expr.
Definition at line 3293 of file ExprCXX.h.
References getMemberLoc().
SourceLocation clang::UnresolvedMemberExpr::getLocEnd | ( | ) | const [inline] |
Reimplemented from clang::Stmt.
Definition at line 3302 of file ExprCXX.h.
References clang::DeclarationNameInfo::getLocEnd(), getMemberNameInfo(), clang::OverloadExpr::getRAngleLoc(), and clang::OverloadExpr::hasExplicitTemplateArgs().
SourceLocation clang::UnresolvedMemberExpr::getLocStart | ( | ) | const [inline] |
Reimplemented from clang::Stmt.
Definition at line 3295 of file ExprCXX.h.
References clang::Stmt::getLocStart(), clang::DeclarationNameInfo::getLocStart(), getMemberNameInfo(), clang::OverloadExpr::getQualifierLoc(), and isImplicitAccess().
Referenced by clang::Sema::BuildCallToMemberFunction().
SourceLocation clang::UnresolvedMemberExpr::getMemberLoc | ( | ) | const [inline] |
Definition at line 3289 of file ExprCXX.h.
References clang::OverloadExpr::getNameLoc().
Referenced by clang::Sema::BuildCallToMemberFunction(), clang::Sema::CheckUnresolvedMemberAccess(), and getExprLoc().
DeclarationName clang::UnresolvedMemberExpr::getMemberName | ( | ) | const [inline] |
Retrieve the name of the member that this expression refers to.
Definition at line 3285 of file ExprCXX.h.
References clang::OverloadExpr::getName().
Referenced by clang::Sema::BuildCallToMemberFunction().
const DeclarationNameInfo& clang::UnresolvedMemberExpr::getMemberNameInfo | ( | ) | const [inline] |
Retrieve the full name info for the member that this expression refers to.
Definition at line 3281 of file ExprCXX.h.
References clang::OverloadExpr::getNameInfo().
Referenced by getLocEnd(), and getLocStart().
CXXRecordDecl * UnresolvedMemberExpr::getNamingClass | ( | ) | const |
Retrieve the naming class of this lookup.
Reimplemented from clang::OverloadExpr.
Definition at line 1400 of file ExprCXX.cpp.
References clang::Type::getAs(), clang::Type::getAsCXXRecordDecl(), clang::NestedNameSpecifier::getAsType(), getBaseType(), clang::QualType::getNonReferenceType(), clang::PointerType::getPointeeType(), clang::OverloadExpr::getQualifier(), isArrow(), Record, and clang::NestedNameSpecifier::Super.
Referenced by clang::Sema::CheckUnresolvedMemberAccess().
SourceLocation clang::UnresolvedMemberExpr::getOperatorLoc | ( | ) | const [inline] |
bool clang::UnresolvedMemberExpr::hasUnresolvedUsing | ( | ) | const [inline] |
bool clang::UnresolvedMemberExpr::isArrow | ( | ) | const [inline] |
Determine whether this member expression used the '->' operator; otherwise, it used the '.' operator.
Definition at line 3271 of file ExprCXX.h.
Referenced by clang::Sema::BuildCallToMemberFunction(), clang::Sema::CheckUnresolvedMemberAccess(), and getNamingClass().
bool UnresolvedMemberExpr::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 1356 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::OverloadExpr.