clang API Documentation
A qualified reference to a name whose declaration cannot yet be resolved. More...
#include <ExprCXX.h>
Public Member Functions | |
const DeclarationNameInfo & | getNameInfo () const |
Retrieve the name that this expression refers to. | |
DeclarationName | getDeclName () const |
Retrieve the name that this expression refers to. | |
SourceLocation | getLocation () const |
Retrieve the location of the name within the expression. | |
NestedNameSpecifierLoc | getQualifierLoc () const |
Retrieve the nested-name-specifier that qualifies the name, with source location information. | |
NestedNameSpecifier * | getQualifier () const |
Retrieve the nested-name-specifier that qualifies this declaration. | |
SourceLocation | getTemplateKeywordLoc () const |
Retrieve the location of the template keyword preceding this name, if any. | |
SourceLocation | getLAngleLoc () const |
Retrieve the location of the left angle bracket starting the explicit template argument list following the name, if any. | |
SourceLocation | getRAngleLoc () const |
Retrieve the location of the right angle bracket ending the explicit template argument list following the name, if any. | |
bool | hasTemplateKeyword () const |
Determines whether the name was preceded by the template keyword. | |
bool | hasExplicitTemplateArgs () const |
Determines whether this lookup had explicit template arguments. | |
ASTTemplateArgumentListInfo & | getExplicitTemplateArgs () |
const ASTTemplateArgumentListInfo & | getExplicitTemplateArgs () const |
Gets a reference to the explicit template argument list. | |
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. | |
TemplateArgumentLoc const * | getTemplateArgs () const |
unsigned | getNumTemplateArgs () const |
SourceLocation | getLocStart () const LLVM_READONLY |
SourceLocation | getLocEnd () const LLVM_READONLY |
child_range | children () |
Static Public Member Functions | |
static DependentScopeDeclRefExpr * | Create (const ASTContext &C, NestedNameSpecifierLoc QualifierLoc, SourceLocation TemplateKWLoc, const DeclarationNameInfo &NameInfo, const TemplateArgumentListInfo *TemplateArgs) |
static DependentScopeDeclRefExpr * | CreateEmpty (const ASTContext &C, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs) |
static bool | classof (const Stmt *T) |
Friends | |
class | ASTStmtReader |
class | ASTStmtWriter |
A qualified reference to a name whose declaration cannot yet be resolved.
DependentScopeDeclRefExpr is similar to DeclRefExpr in that it expresses a reference to a declaration such as X<T>::value. The difference, however, is that an DependentScopeDeclRefExpr node is used only within C++ templates when the qualification (e.g., X<T>::) refers to a dependent type. In this case, X<T>::value cannot resolve to a declaration because the declaration will differ from one instantiation of X<T> to the next. Therefore, DependentScopeDeclRefExpr keeps track of the qualifier (X<T>::) and the name of the entity being referenced ("value"). Such expressions will instantiate to a DeclRefExpr once the declaration can be found.
child_range clang::DependentScopeDeclRefExpr::children | ( | ) | [inline] |
Reimplemented from clang::Stmt.
static bool clang::DependentScopeDeclRefExpr::classof | ( | const Stmt * | T | ) | [inline, static] |
Reimplemented from clang::Expr.
Definition at line 2733 of file ExprCXX.h.
References clang::Stmt::getStmtClass().
void clang::DependentScopeDeclRefExpr::copyTemplateArgumentsInto | ( | TemplateArgumentListInfo & | List | ) | const [inline] |
Copies the template arguments (if present) into the given structure.
Definition at line 2710 of file ExprCXX.h.
References clang::ASTTemplateArgumentListInfo::copyInto(), and getExplicitTemplateArgs().
DependentScopeDeclRefExpr * DependentScopeDeclRefExpr::Create | ( | const ASTContext & | C, |
NestedNameSpecifierLoc | QualifierLoc, | ||
SourceLocation | TemplateKWLoc, | ||
const DeclarationNameInfo & | NameInfo, | ||
const TemplateArgumentListInfo * | TemplateArgs | ||
) | [static] |
Definition at line 450 of file ExprCXX.cpp.
References clang::ASTContext::Allocate(), clang::ASTContext::DependentTy, clang::SourceLocation::isValid(), clang::TemplateArgumentListInfo::size(), and clang::ASTTemplateKWAndArgsInfo::sizeFor().
Referenced by clang::Sema::BuildDependentDeclRefExpr(), clang::Sema::CheckTemplateArgument(), and recoverFromMSUnqualifiedLookup().
DependentScopeDeclRefExpr * DependentScopeDeclRefExpr::CreateEmpty | ( | const ASTContext & | C, |
bool | HasTemplateKWAndArgsInfo, | ||
unsigned | NumTemplateArgs | ||
) | [static] |
Definition at line 467 of file ExprCXX.cpp.
References clang::ASTContext::Allocate(), and clang::ASTTemplateKWAndArgsInfo::sizeFor().
DeclarationName clang::DependentScopeDeclRefExpr::getDeclName | ( | ) | const [inline] |
Retrieve the name that this expression refers to.
Definition at line 2640 of file ExprCXX.h.
References clang::DeclarationNameInfo::getName().
Definition at line 2688 of file ExprCXX.h.
References hasExplicitTemplateArgs().
Referenced by copyTemplateArgumentsInto(), getNumTemplateArgs(), getOptionalExplicitTemplateArgs(), and getTemplateArgs().
const ASTTemplateArgumentListInfo& clang::DependentScopeDeclRefExpr::getExplicitTemplateArgs | ( | ) | const [inline] |
Gets a reference to the explicit template argument list.
Definition at line 2694 of file ExprCXX.h.
References hasExplicitTemplateArgs().
SourceLocation clang::DependentScopeDeclRefExpr::getLAngleLoc | ( | ) | const [inline] |
Retrieve the location of the left angle bracket starting the explicit template argument list following the name, if any.
Definition at line 2666 of file ExprCXX.h.
References clang::ASTTemplateArgumentListInfo::LAngleLoc.
Referenced by hasExplicitTemplateArgs().
SourceLocation clang::DependentScopeDeclRefExpr::getLocation | ( | ) | const [inline] |
Retrieve the location of the name within the expression.
For example, in "X<T>::value" this is the location of "value".
Definition at line 2645 of file ExprCXX.h.
References clang::DeclarationNameInfo::getLoc().
Referenced by getLocEnd().
SourceLocation clang::DependentScopeDeclRefExpr::getLocEnd | ( | ) | const [inline] |
Reimplemented from clang::Stmt.
Definition at line 2727 of file ExprCXX.h.
References getLocation(), getRAngleLoc(), and hasExplicitTemplateArgs().
SourceLocation clang::DependentScopeDeclRefExpr::getLocStart | ( | ) | const [inline] |
Note: getLocStart() is the start of the whole DependentScopeDeclRefExpr, and differs from getLocation().getStart().
Reimplemented from clang::Stmt.
Definition at line 2724 of file ExprCXX.h.
References clang::NestedNameSpecifierLoc::getBeginLoc().
const DeclarationNameInfo& clang::DependentScopeDeclRefExpr::getNameInfo | ( | ) | const [inline] |
unsigned clang::DependentScopeDeclRefExpr::getNumTemplateArgs | ( | ) | const [inline] |
Definition at line 2718 of file ExprCXX.h.
References getExplicitTemplateArgs(), and clang::ASTTemplateArgumentListInfo::NumTemplateArgs.
const ASTTemplateArgumentListInfo* clang::DependentScopeDeclRefExpr::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 2703 of file ExprCXX.h.
References getExplicitTemplateArgs(), and hasExplicitTemplateArgs().
NestedNameSpecifier* clang::DependentScopeDeclRefExpr::getQualifier | ( | ) | const [inline] |
Retrieve the nested-name-specifier that qualifies this declaration.
Definition at line 2653 of file ExprCXX.h.
References clang::NestedNameSpecifierLoc::getNestedNameSpecifier().
NestedNameSpecifierLoc clang::DependentScopeDeclRefExpr::getQualifierLoc | ( | ) | const [inline] |
SourceLocation clang::DependentScopeDeclRefExpr::getRAngleLoc | ( | ) | const [inline] |
Retrieve the location of the right angle bracket ending the explicit template argument list following the name, if any.
Definition at line 2673 of file ExprCXX.h.
References clang::ASTTemplateArgumentListInfo::RAngleLoc.
Referenced by getLocEnd().
TemplateArgumentLoc const* clang::DependentScopeDeclRefExpr::getTemplateArgs | ( | ) | const [inline] |
Definition at line 2714 of file ExprCXX.h.
References getExplicitTemplateArgs(), and clang::ASTTemplateArgumentListInfo::getTemplateArgs().
SourceLocation clang::DependentScopeDeclRefExpr::getTemplateKeywordLoc | ( | ) | const [inline] |
Retrieve the location of the template keyword preceding this name, if any.
Definition at line 2659 of file ExprCXX.h.
References clang::ASTTemplateKWAndArgsInfo::getTemplateKeywordLoc().
Referenced by hasTemplateKeyword().
bool clang::DependentScopeDeclRefExpr::hasExplicitTemplateArgs | ( | ) | const [inline] |
Determines whether this lookup had explicit template arguments.
Definition at line 2682 of file ExprCXX.h.
References getLAngleLoc(), and clang::SourceLocation::isValid().
Referenced by getExplicitTemplateArgs(), getLocEnd(), and getOptionalExplicitTemplateArgs().
bool clang::DependentScopeDeclRefExpr::hasTemplateKeyword | ( | ) | const [inline] |
Determines whether the name was preceded by the template keyword.
Definition at line 2679 of file ExprCXX.h.
References getTemplateKeywordLoc(), and clang::SourceLocation::isValid().
friend class ASTStmtReader [friend] |
Reimplemented from clang::Stmt.
friend class ASTStmtWriter [friend] |
Reimplemented from clang::Stmt.