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 () 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 DependentScopeDeclRefExprCreate (const ASTContext &C, NestedNameSpecifierLoc QualifierLoc, SourceLocation TemplateKWLoc, const DeclarationNameInfo &NameInfo, const TemplateArgumentListInfo *TemplateArgs)
static DependentScopeDeclRefExprCreateEmpty (const ASTContext &C, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs)
static bool classof (const Stmt *T)

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

Definition at line 2596 of file ExprCXX.h.


Member Function Documentation

Reimplemented from clang::Stmt.

Definition at line 2737 of file ExprCXX.h.

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().

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

Retrieve the name that this expression refers to.

Definition at line 2640 of file ExprCXX.h.

References clang::DeclarationNameInfo::getName().

Gets a reference to the explicit template argument list.

Definition at line 2694 of file ExprCXX.h.

References hasExplicitTemplateArgs().

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().

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().

Reimplemented from clang::Stmt.

Definition at line 2727 of file ExprCXX.h.

References getLocation(), getRAngleLoc(), and hasExplicitTemplateArgs().

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().

Retrieve the name that this expression refers to.

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

References getExplicitTemplateArgs(), and hasExplicitTemplateArgs().

Retrieve the nested-name-specifier that qualifies this declaration.

Definition at line 2653 of file ExprCXX.h.

References clang::NestedNameSpecifierLoc::getNestedNameSpecifier().

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

Definition at line 2649 of file ExprCXX.h.

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().

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().

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().

Determines whether the name was preceded by the template keyword.

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

friend class ASTStmtWriter [friend]

Reimplemented from clang::Stmt.

Definition at line 2740 of file ExprCXX.h.


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