class MultiLevelTemplateArgumentList

Declaration

class MultiLevelTemplateArgumentList { /* full declaration omitted */ };

Description

Data structure that captures multiple levels of template argument lists for use in template instantiation. Multiple levels of template arguments occur when instantiating the definitions of member templates. For example: When instantiating X <int >::Y < 17>::f, the multi-level template argument list will contain a template argument list (int) at depth 0 and a template argument list (17) at depth 1.

Declared at: clang/include/clang/Sema/Template.h:75

Member Variables

private SmallVector< clang::MultiLevelTemplateArgumentList:: ArgList, 4> TemplateArgumentLists
The template argument lists, stored from the innermost template argument list (first) to the outermost template argument list (last).
private unsigned int NumRetainedOuterLevels = 0
The number of outer levels of template arguments that are not being substituted.
private clang::TemplateSubstitutionKind Kind = TemplateSubstitutionKind::Specialization
The kind of substitution described by this argument list.

Method Overview

Methods

MultiLevelTemplateArgumentList(
    const clang::TemplateArgumentList&
        TemplateArgs)

Description

Construct a single-level template argument list.

Declared at: clang/include/clang/Sema/Template.h:98

Parameters

const clang::TemplateArgumentList& TemplateArgs

MultiLevelTemplateArgumentList()

Description

Construct an empty set of template argument lists.

Declared at: clang/include/clang/Sema/Template.h:94

void addOuterRetainedLevel()

Description

Add an outermost level that we are not substituting. We have no arguments at this level, and do not remove it from the depth of inner template parameters that we instantiate.

Declared at: clang/include/clang/Sema/Template.h:213

void addOuterRetainedLevels(unsigned int Num)

Declared at: clang/include/clang/Sema/Template.h:216

Parameters

unsigned int Num

void addOuterTemplateArguments(
    clang::MultiLevelTemplateArgumentList::ArgList
        Args)

Description

Add a new outmost level to the multi-level template argument list.

Declared at: clang/include/clang/Sema/Template.h:196

Parameters

clang::MultiLevelTemplateArgumentList::ArgList Args

void addOuterTemplateArguments(
    const clang::TemplateArgumentList*
        TemplateArgs)

Description

Add a new outermost level to the multi-level template argument list.

Declared at: clang/include/clang/Sema/Template.h:189

Parameters

const clang::TemplateArgumentList* TemplateArgs

clang::MultiLevelTemplateArgumentList::
    ConstArgListsIterator
    begin() const

Declared at: clang/include/clang/Sema/Template.h:229

clang::MultiLevelTemplateArgumentList::
    ArgListsIterator
    begin()

Declared at: clang/include/clang/Sema/Template.h:228

clang::MultiLevelTemplateArgumentList::
    ConstArgListsIterator
    end() const

Declared at: clang/include/clang/Sema/Template.h:233

clang::MultiLevelTemplateArgumentList::
    ArgListsIterator
    end()

Declared at: clang/include/clang/Sema/Template.h:232

const clang::MultiLevelTemplateArgumentList::
    ArgList&
    getInnermost() const

Description

Retrieve the innermost template argument list.

Declared at: clang/include/clang/Sema/Template.h:221

clang::TemplateSubstitutionKind getKind() const

Description

Determine the kind of template substitution being performed.

Declared at: clang/include/clang/Sema/Template.h:105

unsigned int getNewDepth(
    unsigned int OldDepth) const

Description

Determine how many of the \p OldDepth outermost template parameter lists would be removed by substituting these arguments.

Declared at: clang/include/clang/Sema/Template.h:138

Parameters

unsigned int OldDepth

unsigned int getNumLevels() const

Description

Determine the number of levels in this template argument list.

Declared at: clang/include/clang/Sema/Template.h:116

unsigned int getNumRetainedOuterLevels() const

Declared at: clang/include/clang/Sema/Template.h:132

unsigned int getNumSubsitutedArgs(
    unsigned int Depth) const

Declared at: clang/include/clang/Sema/Template.h:127

Parameters

unsigned int Depth

unsigned int getNumSubstitutedLevels() const

Description

Determine the number of substituted levels in this template argument list.

Declared at: clang/include/clang/Sema/Template.h:122

const clang::MultiLevelTemplateArgumentList::
    ArgList&
    getOutermost() const

Description

Retrieve the outermost template argument list.

Declared at: clang/include/clang/Sema/Template.h:225

bool hasTemplateArgument(unsigned int Depth,
                         unsigned int Index) const

Description

Determine whether there is a non-NULL template argument at the given depth and index. There must exist a template argument list at the given depth.

Declared at: clang/include/clang/Sema/Template.h:157

Parameters

unsigned int Depth
unsigned int Index

bool isAnyArgInstantiationDependent() const

Declared at: clang/include/clang/Sema/Template.h:169

bool isRewrite() const

Description

Determine whether we are rewriting template parameters rather than substituting for them. If so, we should not leave references to the original template parameters behind.

Declared at: clang/include/clang/Sema/Template.h:110

void replaceInnermostTemplateArguments(
    clang::MultiLevelTemplateArgumentList::ArgList
        Args)

Description

Replaces the current 'innermost' level with the provided argument list. This is useful for type deduction cases where we need to get the entire list from the AST, but then add the deduced innermost list.

Declared at: clang/include/clang/Sema/Template.h:205

Parameters

clang::MultiLevelTemplateArgumentList::ArgList Args

void setArgument(unsigned int Depth,
                 unsigned int Index,
                 clang::TemplateArgument Arg)

Description

Clear out a specific template argument.

Declared at: clang/include/clang/Sema/Template.h:178

Parameters

unsigned int Depth
unsigned int Index
clang::TemplateArgument Arg

void setKind(clang::TemplateSubstitutionKind K)

Declared at: clang/include/clang/Sema/Template.h:102

Parameters

clang::TemplateSubstitutionKind K