class DependentScopeDeclRefExpr

Declaration

class DependentScopeDeclRefExpr : public Expr, private TrailingObjects { /* full declaration omitted */ };

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.

Declared at: clang/include/clang/AST/ExprCXX.h:3208

Inherits from: Expr, TrailingObjects

Member Variables

private clang::NestedNameSpecifierLoc QualifierLoc
The nested-name-specifier that qualifies this unresolved declaration name.
private clang::DeclarationNameInfo NameInfo
The name of the entity we will be referencing.

Inherited from Stmt:

protected

Method Overview

  • public static clang::DependentScopeDeclRefExpr * Create(const clang::ASTContext & Context, clang::NestedNameSpecifierLoc QualifierLoc, clang::SourceLocation TemplateKWLoc, const clang::DeclarationNameInfo & NameInfo, const clang::TemplateArgumentListInfo * TemplateArgs)
  • public static clang::DependentScopeDeclRefExpr * CreateEmpty(const clang::ASTContext & Context, bool HasTemplateKWAndArgsInfo, unsigned int NumTemplateArgs)
  • private DependentScopeDeclRefExpr(clang::QualType Ty, clang::NestedNameSpecifierLoc QualifierLoc, clang::SourceLocation TemplateKWLoc, const clang::DeclarationNameInfo & NameInfo, const clang::TemplateArgumentListInfo * Args)
  • public clang::Stmt::const_child_range children() const
  • public clang::Stmt::child_range children()
  • public static bool classof(const clang::Stmt * T)
  • public void copyTemplateArgumentsInto(clang::TemplateArgumentListInfo & List) const
  • public clang::SourceLocation getBeginLoc() const
  • public clang::DeclarationName getDeclName() const
  • public clang::SourceLocation getEndLoc() const
  • public clang::SourceLocation getLAngleLoc() const
  • public clang::SourceLocation getLocation() const
  • public const clang::DeclarationNameInfo & getNameInfo() const
  • public unsigned int getNumTemplateArgs() const
  • public clang::NestedNameSpecifier * getQualifier() const
  • public clang::NestedNameSpecifierLoc getQualifierLoc() const
  • public clang::SourceLocation getRAngleLoc() const
  • public const clang::TemplateArgumentLoc * getTemplateArgs() const
  • public clang::SourceLocation getTemplateKeywordLoc() const
  • public bool hasExplicitTemplateArgs() const
  • private bool hasTemplateKWAndArgsInfo() const
  • public bool hasTemplateKeyword() const
  • private size_t numTrailingObjects(OverloadToken<clang::ASTTemplateKWAndArgsInfo>) const
  • public ArrayRef<clang::TemplateArgumentLoc> template_arguments() const

Inherited from Expr:

Inherited from ValueStmt:

Inherited from Stmt:

Methods

static clang::DependentScopeDeclRefExpr* Create(
    const clang::ASTContext& Context,
    clang::NestedNameSpecifierLoc QualifierLoc,
    clang::SourceLocation TemplateKWLoc,
    const clang::DeclarationNameInfo& NameInfo,
    const clang::TemplateArgumentListInfo*
        TemplateArgs)

Declared at: clang/include/clang/AST/ExprCXX.h:3239

Parameters

const clang::ASTContext& Context
clang::NestedNameSpecifierLoc QualifierLoc
clang::SourceLocation TemplateKWLoc
const clang::DeclarationNameInfo& NameInfo
const clang::TemplateArgumentListInfo* TemplateArgs

static clang::DependentScopeDeclRefExpr*
CreateEmpty(const clang::ASTContext& Context,
            bool HasTemplateKWAndArgsInfo,
            unsigned int NumTemplateArgs)

Declared at: clang/include/clang/AST/ExprCXX.h:3243

Parameters

const clang::ASTContext& Context
bool HasTemplateKWAndArgsInfo
unsigned int NumTemplateArgs

DependentScopeDeclRefExpr(
    clang::QualType Ty,
    clang::NestedNameSpecifierLoc QualifierLoc,
    clang::SourceLocation TemplateKWLoc,
    const clang::DeclarationNameInfo& NameInfo,
    const clang::TemplateArgumentListInfo* Args)

Declared at: clang/include/clang/AST/ExprCXX.h:3224

Parameters

clang::QualType Ty
clang::NestedNameSpecifierLoc QualifierLoc
clang::SourceLocation TemplateKWLoc
const clang::DeclarationNameInfo& NameInfo
const clang::TemplateArgumentListInfo* Args

clang::Stmt::const_child_range children() const

Declared at: clang/include/clang/AST/ExprCXX.h:3344

clang::Stmt::child_range children()

Declared at: clang/include/clang/AST/ExprCXX.h:3340

static bool classof(const clang::Stmt* T)

Declared at: clang/include/clang/AST/ExprCXX.h:3336

Parameters

const clang::Stmt* T

void copyTemplateArgumentsInto(
    clang::TemplateArgumentListInfo& List) const

Description

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

Declared at: clang/include/clang/AST/ExprCXX.h:3300

Parameters

clang::TemplateArgumentListInfo& List

clang::SourceLocation getBeginLoc() const

Description

Note: getBeginLoc() is the start of the whole DependentScopeDeclRefExpr, and differs from getLocation().getStart().

Declared at: clang/include/clang/AST/ExprCXX.h:3326

clang::DeclarationName getDeclName() const

Description

Retrieve the name that this expression refers to.

Declared at: clang/include/clang/AST/ExprCXX.h:3251

clang::SourceLocation getEndLoc() const

Declared at: clang/include/clang/AST/ExprCXX.h:3330

clang::SourceLocation getLAngleLoc() const

Description

Retrieve the location of the left angle bracket starting the explicit template argument list following the name, if any.

Declared at: clang/include/clang/AST/ExprCXX.h:3278

clang::SourceLocation getLocation() const

Description

Retrieve the location of the name within the expression. For example, in "X<T>::value" this is the location of "value".

Declared at: clang/include/clang/AST/ExprCXX.h:3256

const clang::DeclarationNameInfo& getNameInfo()
    const

Description

Retrieve the name that this expression refers to.

Declared at: clang/include/clang/AST/ExprCXX.h:3248

unsigned int getNumTemplateArgs() const

Declared at: clang/include/clang/AST/ExprCXX.h:3313

clang::NestedNameSpecifier* getQualifier() const

Description

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

Declared at: clang/include/clang/AST/ExprCXX.h:3264

clang::NestedNameSpecifierLoc getQualifierLoc()
    const

Description

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

Declared at: clang/include/clang/AST/ExprCXX.h:3260

clang::SourceLocation getRAngleLoc() const

Description

Retrieve the location of the right angle bracket ending the explicit template argument list following the name, if any.

Declared at: clang/include/clang/AST/ExprCXX.h:3286

const clang::TemplateArgumentLoc*
getTemplateArgs() const

Declared at: clang/include/clang/AST/ExprCXX.h:3306

clang::SourceLocation getTemplateKeywordLoc()
    const

Description

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

Declared at: clang/include/clang/AST/ExprCXX.h:3270

bool hasExplicitTemplateArgs() const

Description

Determines whether this lookup had explicit template arguments.

Declared at: clang/include/clang/AST/ExprCXX.h:3296

bool hasTemplateKWAndArgsInfo() const

Declared at: clang/include/clang/AST/ExprCXX.h:3233

bool hasTemplateKeyword() const

Description

Determines whether the name was preceded by the template keyword.

Declared at: clang/include/clang/AST/ExprCXX.h:3293

size_t numTrailingObjects(
    OverloadToken<
        clang::ASTTemplateKWAndArgsInfo>) const

Declared at: clang/include/clang/AST/ExprCXX.h:3229

Parameters

OverloadToken<clang::ASTTemplateKWAndArgsInfo>

ArrayRef<clang::TemplateArgumentLoc>
template_arguments() const

Declared at: clang/include/clang/AST/ExprCXX.h:3320