class TemplateTemplateParmDecl

Declaration

class TemplateTemplateParmDecl : public TemplateDecl,
                                 protected TemplateParmPosition,
                                 private TrailingObjects { /* full declaration omitted */ };

Description

TemplateTemplateParmDecl - Declares a template template parameter, e.g., "T" in A template template parameter is a TemplateDecl because it defines the name of a template and the template parameters allowable for substitution.

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

Inherits from: TemplateDecl, TemplateParmPosition, TrailingObjects

Member Variables

private clang::TemplateTemplateParmDecl::DefArgStorage DefaultArgument
private bool ParameterPack
Whether this parameter is a parameter pack.
private bool ExpandedParameterPack = false
Whether this template template parameter is an "expanded" parameter pack, meaning that it is a pack expansion and we already know the set of template parameters that expansion expands to.
private unsigned int NumExpandedParams = 0
The number of parameters in an expanded parameter pack.

Inherited from TemplateParmPosition:

protected Depth
protected Position
protected static MaxDepth = (1U << DepthWidth) - 1
protected static MaxPosition = (1U << PositionWidth) - 1

Inherited from TemplateDecl:

protected TemplatedDecl
protected TemplateParams

Inherited from Decl:

protected NextInContextAndBits
protected Access
protected FromASTFile
protected IdentifierNamespace
protected CacheValidAndLinkage

Method Overview

  • public static clang::TemplateTemplateParmDecl * Create(const clang::ASTContext & C, clang::DeclContext * DC, clang::SourceLocation L, unsigned int D, unsigned int P, bool ParameterPack, clang::IdentifierInfo * Id, clang::TemplateParameterList * Params)
  • public static clang::TemplateTemplateParmDecl * Create(const clang::ASTContext & C, clang::DeclContext * DC, clang::SourceLocation L, unsigned int D, unsigned int P, clang::IdentifierInfo * Id, clang::TemplateParameterList * Params, ArrayRef<clang::TemplateParameterList *> Expansions)
  • public static clang::TemplateTemplateParmDecl * CreateDeserialized(clang::ASTContext & C, unsigned int ID)
  • public static clang::TemplateTemplateParmDecl * CreateDeserialized(clang::ASTContext & C, unsigned int ID, unsigned int NumExpansions)
  • private TemplateTemplateParmDecl(clang::DeclContext * DC, clang::SourceLocation L, unsigned int D, unsigned int P, clang::IdentifierInfo * Id, clang::TemplateParameterList * Params, ArrayRef<clang::TemplateParameterList *> Expansions)
  • private TemplateTemplateParmDecl(clang::DeclContext * DC, clang::SourceLocation L, unsigned int D, unsigned int P, bool ParameterPack, clang::IdentifierInfo * Id, clang::TemplateParameterList * Params)
  • private void anchor()
  • public static bool classof(const clang::Decl * D)
  • public static bool classofKind(clang::Decl::Kind K)
  • public bool defaultArgumentWasInherited() const
  • public const clang::TemplateTemplateParmDecl::DefArgStorage & getDefaultArgStorage() const
  • public const clang::TemplateArgumentLoc & getDefaultArgument() const
  • public clang::SourceLocation getDefaultArgumentLoc() const
  • public clang::TemplateParameterList * getExpansionTemplateParameters(unsigned int I) const
  • public unsigned int getNumExpansionTemplateParameters() const
  • public clang::SourceRange getSourceRange() const
  • public bool hasDefaultArgument() const
  • public bool isExpandedParameterPack() const
  • public bool isPackExpansion() const
  • public bool isParameterPack() const
  • public void removeDefaultArgument()
  • public void setDefaultArgument(const clang::ASTContext & C, const clang::TemplateArgumentLoc & DefArg)
  • public void setInheritedDefaultArgument(const clang::ASTContext & C, clang::TemplateTemplateParmDecl * Prev)

Inherited from TemplateParmPosition:

Inherited from TemplateDecl:

Inherited from NamedDecl:

Inherited from Decl:

Methods

static clang::TemplateTemplateParmDecl* Create(
    const clang::ASTContext& C,
    clang::DeclContext* DC,
    clang::SourceLocation L,
    unsigned int D,
    unsigned int P,
    bool ParameterPack,
    clang::IdentifierInfo* Id,
    clang::TemplateParameterList* Params)

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

Parameters

const clang::ASTContext& C
clang::DeclContext* DC
clang::SourceLocation L
unsigned int D
unsigned int P
bool ParameterPack
clang::IdentifierInfo* Id
clang::TemplateParameterList* Params

static clang::TemplateTemplateParmDecl* Create(
    const clang::ASTContext& C,
    clang::DeclContext* DC,
    clang::SourceLocation L,
    unsigned int D,
    unsigned int P,
    clang::IdentifierInfo* Id,
    clang::TemplateParameterList* Params,
    ArrayRef<clang::TemplateParameterList*>
        Expansions)

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

Parameters

const clang::ASTContext& C
clang::DeclContext* DC
clang::SourceLocation L
unsigned int D
unsigned int P
clang::IdentifierInfo* Id
clang::TemplateParameterList* Params
ArrayRef<clang::TemplateParameterList*> Expansions

static clang::TemplateTemplateParmDecl*
CreateDeserialized(clang::ASTContext& C,
                   unsigned int ID)

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

Parameters

clang::ASTContext& C
unsigned int ID

static clang::TemplateTemplateParmDecl*
CreateDeserialized(clang::ASTContext& C,
                   unsigned int ID,
                   unsigned int NumExpansions)

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

Parameters

clang::ASTContext& C
unsigned int ID
unsigned int NumExpansions

TemplateTemplateParmDecl(
    clang::DeclContext* DC,
    clang::SourceLocation L,
    unsigned int D,
    unsigned int P,
    clang::IdentifierInfo* Id,
    clang::TemplateParameterList* Params,
    ArrayRef<clang::TemplateParameterList*>
        Expansions)

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

Parameters

clang::DeclContext* DC
clang::SourceLocation L
unsigned int D
unsigned int P
clang::IdentifierInfo* Id
clang::TemplateParameterList* Params
ArrayRef<clang::TemplateParameterList*> Expansions

TemplateTemplateParmDecl(
    clang::DeclContext* DC,
    clang::SourceLocation L,
    unsigned int D,
    unsigned int P,
    bool ParameterPack,
    clang::IdentifierInfo* Id,
    clang::TemplateParameterList* Params)

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

Parameters

clang::DeclContext* DC
clang::SourceLocation L
unsigned int D
unsigned int P
bool ParameterPack
clang::IdentifierInfo* Id
clang::TemplateParameterList* Params

void anchor()

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

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

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

Parameters

const clang::Decl* D

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

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

Parameters

clang::Decl::Kind K

bool defaultArgumentWasInherited() const

Description

Determines whether the default argument was inherited from a previous declaration of this template.

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

const clang::TemplateTemplateParmDecl::
    DefArgStorage&
    getDefaultArgStorage() const

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

const clang::TemplateArgumentLoc&
getDefaultArgument() const

Description

Retrieve the default argument, if any.

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

clang::SourceLocation getDefaultArgumentLoc()
    const

Description

Retrieve the location of the default argument, if any.

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

clang::TemplateParameterList*
getExpansionTemplateParameters(
    unsigned int I) const

Description

Retrieve a particular expansion type within an expanded parameter pack.

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

Parameters

unsigned int I

unsigned int getNumExpansionTemplateParameters()
    const

Description

Retrieves the number of expansion template parameters in an expanded parameter pack.

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

clang::SourceRange getSourceRange() const

Description

Source range that this declaration covers.

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

bool hasDefaultArgument() const

Description

Determine whether this template parameter has a default argument.

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

bool isExpandedParameterPack() const

Description

Whether this parameter is a template template parameter pack that has a known list of different template parameter lists at different positions. A parameter pack is an expanded parameter pack when the original parameter pack's template parameter list was itself a pack expansion, and that expansion has already been expanded. For exampe, given: The parameter pack \c Templates is a pack expansion, which expands the pack \c Types. When \c Types is supplied with template arguments by instantiating \c Outer, the instantiation of \c Templates is an expanded parameter pack.

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

bool isPackExpansion() const

Description

Whether this parameter pack is a pack expansion. A template template parameter pack is a pack expansion if its template parameter list contains an unexpanded parameter pack.

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

bool isParameterPack() const

Description

Whether this template template parameter is a template parameter pack.

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

void removeDefaultArgument()

Description

Removes the default argument of this template parameter.

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

void setDefaultArgument(
    const clang::ASTContext& C,
    const clang::TemplateArgumentLoc& DefArg)

Description

Set the default argument for this template parameter, and whether that default argument was inherited from another declaration.

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

Parameters

const clang::ASTContext& C
const clang::TemplateArgumentLoc& DefArg

void setInheritedDefaultArgument(
    const clang::ASTContext& C,
    clang::TemplateTemplateParmDecl* Prev)

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

Parameters

const clang::ASTContext& C
clang::TemplateTemplateParmDecl* Prev