clang  3.9.0
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 <DeclTemplate.h>

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

Public Types

typedef NamedDecl ** iterator
 Iterates through the template parameters in this list. More...
 
typedef NamedDecl *const * const_iterator
 Iterates through the template parameters in this list. More...
 

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...
 
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)
 

Public Attributes

friend TrailingObjects
 

Protected Member Functions

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

Friends

template<size_t N>
class FixedSizeTemplateParameterListStorage
 

Detailed Description

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

Definition at line 49 of file DeclTemplate.h.

Member Typedef Documentation

Iterates through the template parameters in this list.

Definition at line 85 of file DeclTemplate.h.

Iterates through the template parameters in this list.

Definition at line 82 of file DeclTemplate.h.

Constructor & Destructor Documentation

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

Definition at line 31 of file DeclTemplate.cpp.

References begin(), and P.

Referenced by Create().

Member Function Documentation

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

Definition at line 94 of file DeclTemplate.h.

References begin(), and end().

Referenced by getMinRequiredArguments().

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

Definition at line 97 of file DeclTemplate.h.

References begin(), and size().

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

Definition at line 88 of file DeclTemplate.h.

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

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

Definition at line 127 of file DeclTemplate.h.

TemplateParameterList * TemplateParameterList::Create ( const ASTContext C,
SourceLocation  TemplateLoc,
SourceLocation  LAngleLoc,
ArrayRef< NamedDecl * >  Params,
SourceLocation  RAngleLoc 
)
static
iterator clang::TemplateParameterList::end ( )
inline
const_iterator clang::TemplateParameterList::end ( ) const
inline

Definition at line 90 of file DeclTemplate.h.

References begin().

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 94 of file DeclTemplate.cpp.

References getParam(), and size().

Referenced by hasDeducibleTemplateParameters(), isAtLeastAsSpecializedAs(), isSameAsPrimaryTemplate(), and clang::Sema::MarkDeducedTemplateParameters().

SourceLocation clang::TemplateParameterList::getLAngleLoc ( ) const
inline
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 66 of file DeclTemplate.cpp.

References asArray(), and P.

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

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

Definition at line 106 of file DeclTemplate.h.

References begin(), and size().

SourceLocation clang::TemplateParameterList::getRAngleLoc ( ) const
inline
SourceRange clang::TemplateParameterList::getSourceRange ( ) const
inline
SourceLocation clang::TemplateParameterList::getTemplateLoc ( ) const
inline
size_t clang::TemplateParameterList::numTrailingObjects ( OverloadToken< NamedDecl * >  ) const
inlineprotected

Definition at line 67 of file DeclTemplate.h.

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

Definition at line 92 of file DeclTemplate.h.

Referenced by clang::Sema::ActOnClassTemplateSpecialization(), clang::Sema::ActOnCXXMemberDeclarator(), clang::Sema::ActOnTemplateTemplateParameter(), clang::comments::Sema::actOnTParamCommandParamNameArg(), clang::Sema::ActOnVariableDeclarator(), clang::ASTRecordWriter::AddTemplateParameterList(), asArray(), clang::Sema::CheckClassTemplate(), checkLiteralOperatorTemplateParameterList(), CheckTemplatePartialSpecializationArgs(), clang::PredefinedExpr::ComputeName(), clang::Sema::DeduceTemplateArguments(), diagnoseArityMismatch(), DiagnoseTemplateParameterListArityMismatch(), DiagnoseUnexpandedParameterPacks(), FinishTemplateArgumentDeduction(), clang::Sema::FinishTemplateArgumentDeduction(), getDepth(), clang::ClassTemplateDecl::getInjectedClassNameSpecialization(), clang::FunctionTemplateDecl::getInjectedTemplateArgs(), clang::Sema::getMoreSpecializedPartialSpecialization(), getParam(), clang::Sema::getTemplateArgumentBindingsText(), hasDeducibleTemplateParameters(), clang::ASTNodeImporter::ImportTemplateParameterList(), isAtLeastAsSpecializedAs(), isSameAsPrimaryTemplate(), isSameTemplateParameterList(), IsStructurallyEquivalent(), clang::Sema::LookupLiteralOperator(), clang::Sema::MarkDeducedTemplateParameters(), clang::Sema::RebuildTemplateParamsInCurrentInstantiation(), ResolveOverloadForDeduction(), clang::Sema::SubstituteExplicitTemplateArguments(), clang::TemplateDeclInstantiator::SubstTemplateParams(), and clang::Sema::TemplateParameterListsAreEqual().

Friends And Related Function Documentation

template<size_t N>
friend class FixedSizeTemplateParameterListStorage
friend

Definition at line 140 of file DeclTemplate.h.

Member Data Documentation

friend clang::TemplateParameterList::TrailingObjects

Definition at line 139 of file DeclTemplate.h.


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