class TemplateDecl

Declaration

class TemplateDecl : public NamedDecl { /* full declaration omitted */ };

Description

The base class of all kinds of template declarations (e.g., class, function, etc.).

The TemplateDecl class stores the list of template parameters and a reference to the templated scoped declaration: the underlying AST node.

Declared at: clang/include/clang/AST/DeclTemplate.h:409

Inherits from: NamedDecl

Member Variables

protected clang::NamedDecl* TemplatedDecl
protected clang::TemplateParameterList* TemplateParams

Inherited from Decl:

protected NextInContextAndBits
protected Access
protected FromASTFile
protected IdentifierNamespace
protected CacheValidAndLinkage

Method Overview

  • protected TemplateDecl(clang::Decl::Kind DK, clang::DeclContext * DC, clang::SourceLocation L, clang::DeclarationName Name, clang::TemplateParameterList * Params, clang::NamedDecl * Decl)
  • protected TemplateDecl(clang::Decl::Kind DK, clang::DeclContext * DC, clang::SourceLocation L, clang::DeclarationName Name, clang::TemplateParameterList * Params)
  • private void anchor()
  • public static bool classof(const clang::Decl * D)
  • public static bool classofKind(clang::Decl::Kind K)
  • public void getAssociatedConstraints(llvm::SmallVectorImpl<const Expr *> & AC) const
  • public clang::SourceRange getSourceRange() const
  • public clang::TemplateParameterList * getTemplateParameters() const
  • public clang::NamedDecl * getTemplatedDecl() const
  • public bool hasAssociatedConstraints() const
  • public void init(clang::NamedDecl * templatedDecl, clang::TemplateParameterList * templateParams)
  • protected void setTemplateParameters(clang::TemplateParameterList * TParams)

Inherited from NamedDecl:

Inherited from Decl:

Methods

TemplateDecl(clang::Decl::Kind DK,
             clang::DeclContext* DC,
             clang::SourceLocation L,
             clang::DeclarationName Name,
             clang::TemplateParameterList* Params,
             clang::NamedDecl* Decl)

Declared at: clang/include/clang/AST/DeclTemplate.h:414

Parameters

clang::Decl::Kind DK
clang::DeclContext* DC
clang::SourceLocation L
clang::DeclarationName Name
clang::TemplateParameterList* Params
clang::NamedDecl* Decl

TemplateDecl(clang::Decl::Kind DK,
             clang::DeclContext* DC,
             clang::SourceLocation L,
             clang::DeclarationName Name,
             clang::TemplateParameterList* Params)

Declared at: clang/include/clang/AST/DeclTemplate.h:419

Parameters

clang::Decl::Kind DK
clang::DeclContext* DC
clang::SourceLocation L
clang::DeclarationName Name
clang::TemplateParameterList* Params

void anchor()

Declared at: clang/include/clang/AST/DeclTemplate.h:410

static bool classof(const clang::Decl* D)

Declared at: clang/include/clang/AST/DeclTemplate.h:444

Parameters

const clang::Decl* D

static bool classofKind(clang::Decl::Kind K)

Declared at: clang/include/clang/AST/DeclTemplate.h:446

Parameters

clang::Decl::Kind K

void getAssociatedConstraints(
    llvm::SmallVectorImpl<const Expr*>& AC) const

Description

Get the total constraint-expression associated with this template, including constraint-expressions derived from the requires-clause, trailing requires-clause (for functions and methods) and constrained template parameters.

Declared at: clang/include/clang/AST/DeclTemplate.h:436

Parameters

llvm::SmallVectorImpl<const Expr*>& AC

clang::SourceRange getSourceRange() const

Description

Source range that this declaration covers.

Declared at: clang/include/clang/AST/DeclTemplate.h:450

clang::TemplateParameterList*
getTemplateParameters() const

Description

Get the list of template parameters

Declared at: clang/include/clang/AST/DeclTemplate.h:428

clang::NamedDecl* getTemplatedDecl() const

Description

Get the underlying, templated declaration.

Declared at: clang/include/clang/AST/DeclTemplate.h:441

bool hasAssociatedConstraints() const

Declared at: clang/include/clang/AST/DeclTemplate.h:438

void init(
    clang::NamedDecl* templatedDecl,
    clang::TemplateParameterList* templateParams)

Description

Initialize the underlying templated declaration and template parameters.

Declared at: clang/include/clang/AST/DeclTemplate.h:466

Parameters

clang::NamedDecl* templatedDecl
clang::TemplateParameterList* templateParams

void setTemplateParameters(
    clang::TemplateParameterList* TParams)

Declared at: clang/include/clang/AST/DeclTemplate.h:459

Parameters

clang::TemplateParameterList* TParams