clang API Documentation

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

A qualified reference to a name whose declaration cannot yet be resolved. More...

#include <ExprCXX.h>

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

List of all members.

Public Member Functions

const DeclarationNameInfogetNameInfo () 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.
NestedNameSpecifiergetQualifier () 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.
ASTTemplateArgumentListInfogetExplicitTemplateArgs ()
const ASTTemplateArgumentListInfogetExplicitTemplateArgs () const
 Gets a reference to the explicit template argument list.
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.
TemplateArgumentLoc const * getTemplateArgs () const
unsigned getNumTemplateArgs () const
SourceRange getSourceRange () const LLVM_READONLY
child_range children ()

Static Public Member Functions

static DependentScopeDeclRefExprCreate (ASTContext &C, NestedNameSpecifierLoc QualifierLoc, SourceLocation TemplateKWLoc, const DeclarationNameInfo &NameInfo, const TemplateArgumentListInfo *TemplateArgs)
static DependentScopeDeclRefExprCreateEmpty (ASTContext &C, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs)
static bool classof (const Stmt *T)
static bool classof (const DependentScopeDeclRefExpr *)

Friends

class ASTStmtReader
class ASTStmtWriter

Detailed Description

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 on 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.

Definition at line 2546 of file ExprCXX.h.


Member Function Documentation

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

Reimplemented from clang::Stmt.

Definition at line 2682 of file ExprCXX.h.

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

Reimplemented from clang::Expr.

Definition at line 2677 of file ExprCXX.h.

References clang::Stmt::getStmtClass().

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

Definition at line 2680 of file ExprCXX.h.

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

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

Definition at line 2658 of file ExprCXX.h.

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

DependentScopeDeclRefExpr * DependentScopeDeclRefExpr::Create ( ASTContext C,
NestedNameSpecifierLoc  QualifierLoc,
SourceLocation  TemplateKWLoc,
const DeclarationNameInfo NameInfo,
const TemplateArgumentListInfo TemplateArgs 
) [static]
DependentScopeDeclRefExpr * DependentScopeDeclRefExpr::CreateEmpty ( ASTContext C,
bool  HasTemplateKWAndArgsInfo,
unsigned  NumTemplateArgs 
) [static]
DeclarationName clang::DependentScopeDeclRefExpr::getDeclName ( ) const [inline]

Retrieve the name that this expression refers to.

Definition at line 2590 of file ExprCXX.h.

References clang::DeclarationNameInfo::getName().

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

Gets a reference to the explicit template argument list.

Definition at line 2643 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 2615 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.

Definition at line 2593 of file ExprCXX.h.

References clang::DeclarationNameInfo::getLoc().

Referenced by getSourceRange().

const DeclarationNameInfo& clang::DependentScopeDeclRefExpr::getNameInfo ( ) const [inline]

Retrieve the name that this expression refers to.

Definition at line 2587 of file ExprCXX.h.

unsigned clang::DependentScopeDeclRefExpr::getNumTemplateArgs ( ) const [inline]
const ASTTemplateArgumentListInfo* clang::DependentScopeDeclRefExpr::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 2651 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 2602 of file ExprCXX.h.

References clang::NestedNameSpecifierLoc::getNestedNameSpecifier().

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

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

Definition at line 2597 of file ExprCXX.h.

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

References clang::ASTTemplateArgumentListInfo::RAngleLoc.

Referenced by getSourceRange().

SourceRange clang::DependentScopeDeclRefExpr::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 2670 of file ExprCXX.h.

References clang::NestedNameSpecifierLoc::getBeginLoc(), getLocation(), getRAngleLoc(), hasExplicitTemplateArgs(), and clang::SourceRange::setEnd().

TemplateArgumentLoc const* clang::DependentScopeDeclRefExpr::getTemplateArgs ( ) const [inline]
SourceLocation clang::DependentScopeDeclRefExpr::getTemplateKeywordLoc ( ) const [inline]

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

Definition at line 2608 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 2631 of file ExprCXX.h.

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

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

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

Determines whether the name was preceded by the template keyword.

Definition at line 2628 of file ExprCXX.h.

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


Friends And Related Function Documentation

friend class ASTStmtReader [friend]

Reimplemented from clang::Stmt.

Definition at line 2684 of file ExprCXX.h.

friend class ASTStmtWriter [friend]

Reimplemented from clang::Stmt.

Definition at line 2685 of file ExprCXX.h.


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