clang 10.0.0git

Public Member Functions | List of all members
clang::MultiLevelTemplateArgumentList Class Reference

Data structure that captures multiple levels of template argument lists for use in template instantiation. More...

`#include "clang/Sema/Template.h"`

## Public Member Functions
| MultiLevelTemplateArgumentList ()=default
| Construct an empty set of template argument lists. More...
| MultiLevelTemplateArgumentList (const TemplateArgumentList &TemplateArgs)
| Construct a single-level template argument list. More...
unsigned | getNumLevels () const
| Determine the number of levels in this template argument list. More...
unsigned | getNumSubstitutedLevels () const
| Determine the number of substituted levels in this template argument list. More...
const TemplateArgument & | operator() (unsigned Depth, unsigned Index) const
| Retrieve the template argument at a given depth and index. More...
bool | hasTemplateArgument (unsigned Depth, unsigned Index) const
| Determine whether there is a non-NULL template argument at the given depth and index. More...
void | setArgument (unsigned Depth, unsigned Index, TemplateArgument Arg)
| Clear out a specific template argument. More...
void | addOuterTemplateArguments (const TemplateArgumentList *TemplateArgs)
| Add a new outermost level to the multi-level template argument list. More...
void | addOuterTemplateArguments (ArgList Args)
| Add a new outmost level to the multi-level template argument list. More...
void | addOuterRetainedLevel ()
| Add an outermost level that we are not substituting. More...
const ArgList & | getInnermost () const
| Retrieve the innermost template argument list. More...

## Detailed 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:

template<typename T>
struct X {
template<T Value>
struct Y {
void f();
};
};

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.

Definition at line 64 of file Template.h.

## Constructor & Destructor Documentation

## ◆ MultiLevelTemplateArgumentList() [1/2]

clang::MultiLevelTemplateArgumentList::MultiLevelTemplateArgumentList | ( |  | ) |
| default

Construct an empty set of template argument lists.

## ◆ MultiLevelTemplateArgumentList() [2/2]

clang::MultiLevelTemplateArgumentList::MultiLevelTemplateArgumentList | ( | const TemplateArgumentList & | TemplateArgs | ) |
| inline explicit

Construct a single-level template argument list.

Definition at line 82 of file Template.h.

References addOuterTemplateArguments().

## Member Function Documentation

## ◆ addOuterRetainedLevel()

void clang::MultiLevelTemplateArgumentList::addOuterRetainedLevel | ( |  | ) |
| inline

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.

Definition at line 149 of file Template.h.

## ◆ addOuterTemplateArguments() [1/2]

void clang::MultiLevelTemplateArgumentList::addOuterTemplateArguments | ( | const TemplateArgumentList * | TemplateArgs | ) |
| inline

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

Definition at line 133 of file Template.h.

References clang::TemplateArgumentList::data(), and clang::TemplateArgumentList::size().

Referenced by clang::Sema::BuildVarTemplateInstantiation(), clang::Sema::getTemplateInstantiationArgs(), MultiLevelTemplateArgumentList(), and SubstDefaultTemplateArgument().

## ◆ addOuterTemplateArguments() [2/2]

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

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

Definition at line 140 of file Template.h.

## ◆ getInnermost()

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

Retrieve the innermost template argument list.

Definition at line 154 of file Template.h.

Referenced by clang::Sema::CheckCXXDefaultArgExpr(), clang::Sema::FindInstantiatedDecl(), clang::TemplateDeclInstantiator::VisitCXXMethodDecl(), and clang::TemplateDeclInstantiator::VisitFunctionDecl().

## ◆ getNumLevels()

unsigned clang::MultiLevelTemplateArgumentList::getNumLevels | ( |  | ) | const
| inline

Determine the number of levels in this template argument list.

Definition at line 88 of file Template.h.

## ◆ getNumSubstitutedLevels()

unsigned clang::MultiLevelTemplateArgumentList::getNumSubstitutedLevels | ( |  | ) | const
| inline

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

Definition at line 94 of file Template.h.

Referenced by clang::TemplateDeclInstantiator::VisitCXXMethodDecl().

## ◆ hasTemplateArgument()

bool clang::MultiLevelTemplateArgumentList::hasTemplateArgument | ( | unsigned | Depth,
|  | unsigned | Index
| ) |  | const
| inline

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.

Definition at line 109 of file Template.h.

## ◆ operator()()

const TemplateArgument& clang::MultiLevelTemplateArgumentList::operator() | ( | unsigned | Depth,
|  | unsigned | Index
| ) |  | const
| inline

Retrieve the template argument at a given depth and index.

Definition at line 99 of file Template.h.

## ◆ setArgument()

void clang::MultiLevelTemplateArgumentList::setArgument | ( | unsigned | Depth,
|  | unsigned | Index,
|  | TemplateArgument | Arg
| ) |  |
| inline

Clear out a specific template argument.

Definition at line 122 of file Template.h.

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

- include/clang/Sema/Template.h