clang  6.0.0svn
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Friends | List of all members
clang::TemplateParameterList Class Referencefinal

Stores a list of template parameters for a TemplateDecl and its derived classes. More...

#include "clang/AST/DeclTemplate.h"

Inheritance diagram for clang::TemplateParameterList:
Inheritance graph
[legend]
Collaboration diagram for clang::TemplateParameterList:
Collaboration graph
[legend]

Public Types

using iterator = NamedDecl **
 Iterates through the template parameters in this list. More...
 
using const_iterator = NamedDecl *const *
 Iterates through the template parameters in this list. More...
 
using FixedSizeStorageOwner = TrailingObjects::FixedSizeStorageOwner
 

Public Member Functions

iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
unsigned size () const
 
ArrayRef< NamedDecl * > asArray ()
 
ArrayRef< const NamedDecl * > asArray () const
 
NamedDeclgetParam (unsigned Idx)
 
const NamedDeclgetParam (unsigned Idx) const
 
unsigned getMinRequiredArguments () const
 Returns the minimum number of arguments needed to form a template specialization. More...
 
unsigned getDepth () const
 Get the depth of this template parameter list in the set of template parameter lists. More...
 
bool containsUnexpandedParameterPack () const
 Determine whether this template parameter list contains an unexpanded parameter pack. More...
 
ExprgetRequiresClause ()
 The constraint-expression of the associated requires-clause. More...
 
const ExprgetRequiresClause () const
 The constraint-expression of the associated requires-clause. More...
 
SourceLocation getTemplateLoc () const
 
SourceLocation getLAngleLoc () const
 
SourceLocation getRAngleLoc () const
 
SourceRange getSourceRange () const LLVM_READONLY
 

Static Public Member Functions

static TemplateParameterListCreate (const ASTContext &C, SourceLocation TemplateLoc, SourceLocation LAngleLoc, ArrayRef< NamedDecl *> Params, SourceLocation RAngleLoc, Expr *RequiresClause)
 

Public Attributes

friend TrailingObjects
 

Protected Member Functions

 TemplateParameterList (SourceLocation TemplateLoc, SourceLocation LAngleLoc, ArrayRef< NamedDecl *> Params, SourceLocation RAngleLoc, Expr *RequiresClause)
 
size_t numTrailingObjects (OverloadToken< NamedDecl *>) const
 
size_t numTrailingObjects (OverloadToken< Expr *>) const
 

Friends

template<size_t N, bool HasRequiresClause>
class FixedSizeTemplateParameterListStorage
 

Detailed Description

Stores a list of template parameters for a TemplateDecl and its derived classes.

Definition at line 68 of file DeclTemplate.h.

Member Typedef Documentation

◆ const_iterator

Iterates through the template parameters in this list.

Definition at line 117 of file DeclTemplate.h.

◆ FixedSizeStorageOwner

using clang::TemplateParameterList::FixedSizeStorageOwner = TrailingObjects::FixedSizeStorageOwner

Definition at line 182 of file DeclTemplate.h.

◆ iterator

Iterates through the template parameters in this list.

Definition at line 114 of file DeclTemplate.h.

Constructor & Destructor Documentation

◆ TemplateParameterList()

TemplateParameterList::TemplateParameterList ( SourceLocation  TemplateLoc,
SourceLocation  LAngleLoc,
ArrayRef< NamedDecl *>  Params,
SourceLocation  RAngleLoc,
Expr RequiresClause 
)
protected

Definition at line 46 of file DeclTemplate.cpp.

References begin(), clang::Decl::isTemplateParameterPack(), and P.

Referenced by Create().

Member Function Documentation

◆ asArray() [1/2]

ArrayRef<NamedDecl*> clang::TemplateParameterList::asArray ( )
inline

Definition at line 126 of file DeclTemplate.h.

References begin(), and end().

Referenced by clang::ODRHash::AddTemplateParameterList(), and getMinRequiredArguments().

◆ asArray() [2/2]

ArrayRef<const NamedDecl*> clang::TemplateParameterList::asArray ( ) const
inline

Definition at line 129 of file DeclTemplate.h.

References begin(), and size().

◆ begin() [1/2]

iterator clang::TemplateParameterList::begin ( )
inline

◆ begin() [2/2]

const_iterator clang::TemplateParameterList::begin ( ) const
inline

Definition at line 120 of file DeclTemplate.h.

◆ containsUnexpandedParameterPack()

bool clang::TemplateParameterList::containsUnexpandedParameterPack ( ) const
inline

Determine whether this template parameter list contains an unexpanded parameter pack.

Definition at line 158 of file DeclTemplate.h.

◆ Create()

TemplateParameterList * TemplateParameterList::Create ( const ASTContext C,
SourceLocation  TemplateLoc,
SourceLocation  LAngleLoc,
ArrayRef< NamedDecl *>  Params,
SourceLocation  RAngleLoc,
Expr RequiresClause 
)
static

◆ end() [1/2]

iterator clang::TemplateParameterList::end ( )
inline

◆ end() [2/2]

const_iterator clang::TemplateParameterList::end ( ) const
inline

Definition at line 122 of file DeclTemplate.h.

References begin().

◆ getDepth()

unsigned TemplateParameterList::getDepth ( ) const

Get the depth of this template parameter list in the set of template parameter lists.

The first template parameter list in a declaration will have depth 0, the second template parameter list will have depth 1, etc.

Definition at line 116 of file DeclTemplate.cpp.

References getParam(), and size().

Referenced by clang::TemplateTypeParmDecl::getDepth(), getParam(), hasDeducibleTemplateParameters(), isSameAsPrimaryTemplate(), and clang::TemplateTypeParmDecl::setDeclaredWithTypename().

◆ getLAngleLoc()

SourceLocation clang::TemplateParameterList::getLAngleLoc ( ) const
inline

◆ getMinRequiredArguments()

unsigned TemplateParameterList::getMinRequiredArguments ( ) const

Returns the minimum number of arguments needed to form a template specialization.

This may be fewer than the number of template parameters, if some of the parameters have default arguments or if there is a parameter pack.

Definition at line 88 of file DeclTemplate.cpp.

References asArray(), and P.

Referenced by getParam(), clang::Sema::isStdInitializerList(), and LookupStdInitializerList().

◆ getParam() [1/2]

NamedDecl* clang::TemplateParameterList::getParam ( unsigned  Idx)
inline

◆ getParam() [2/2]

const NamedDecl* clang::TemplateParameterList::getParam ( unsigned  Idx) const
inline

Definition at line 137 of file DeclTemplate.h.

References begin(), getDepth(), getMinRequiredArguments(), and size().

◆ getRAngleLoc()

SourceLocation clang::TemplateParameterList::getRAngleLoc ( ) const
inline

◆ getRequiresClause() [1/2]

Expr* clang::TemplateParameterList::getRequiresClause ( )
inline

The constraint-expression of the associated requires-clause.

Definition at line 163 of file DeclTemplate.h.

Referenced by clang::formAssociatedConstraints(), clang::TemplateDecl::getRequiresClause(), and clang::ASTNodeImporter::ImportTemplateParameterList().

◆ getRequiresClause() [2/2]

const Expr* clang::TemplateParameterList::getRequiresClause ( ) const
inline

The constraint-expression of the associated requires-clause.

Definition at line 168 of file DeclTemplate.h.

◆ getSourceRange()

SourceRange clang::TemplateParameterList::getSourceRange ( ) const
inline

◆ getTemplateLoc()

SourceLocation clang::TemplateParameterList::getTemplateLoc ( ) const
inline

◆ numTrailingObjects() [1/2]

size_t clang::TemplateParameterList::numTrailingObjects ( OverloadToken< NamedDecl *>  ) const
inlineprotected

Definition at line 93 of file DeclTemplate.h.

◆ numTrailingObjects() [2/2]

size_t clang::TemplateParameterList::numTrailingObjects ( OverloadToken< Expr *>  ) const
inlineprotected

Definition at line 97 of file DeclTemplate.h.

◆ size()

unsigned clang::TemplateParameterList::size ( ) const
inline

Friends And Related Function Documentation

◆ FixedSizeTemplateParameterListStorage

template<size_t N, bool HasRequiresClause>
friend class FixedSizeTemplateParameterListStorage
friend

Definition at line 103 of file DeclTemplate.h.

Member Data Documentation

◆ TrailingObjects

friend clang::TemplateParameterList::TrailingObjects

Definition at line 104 of file DeclTemplate.h.


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