clang
9.0.0
|
Stores a list of template parameters for a TemplateDecl and its derived classes. More...
#include "clang/AST/DeclTemplate.h"
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 |
NamedDecl * | getParam (unsigned Idx) |
const NamedDecl * | getParam (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... | |
Expr * | getRequiresClause () |
The constraint-expression of the associated requires-clause. More... | |
const Expr * | getRequiresClause () const |
The constraint-expression of the associated requires-clause. More... | |
SourceLocation | getTemplateLoc () const |
SourceLocation | getLAngleLoc () const |
SourceLocation | getRAngleLoc () const |
SourceRange | getSourceRange () const LLVM_READONLY |
void | print (raw_ostream &Out, const ASTContext &Context, bool OmitTemplateKW=false) const |
void | print (raw_ostream &Out, const ASTContext &Context, const PrintingPolicy &Policy, bool OmitTemplateKW=false) const |
Static Public Member Functions | |
static TemplateParameterList * | Create (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 |
Stores a list of template parameters for a TemplateDecl and its derived classes.
Definition at line 67 of file DeclTemplate.h.
using clang::TemplateParameterList::const_iterator = NamedDecl * const * |
Iterates through the template parameters in this list.
Definition at line 116 of file DeclTemplate.h.
using clang::TemplateParameterList::FixedSizeStorageOwner = TrailingObjects::FixedSizeStorageOwner |
Definition at line 186 of file DeclTemplate.h.
using clang::TemplateParameterList::iterator = NamedDecl ** |
Iterates through the template parameters in this list.
Definition at line 113 of file DeclTemplate.h.
|
protected |
Definition at line 46 of file DeclTemplate.cpp.
References begin(), clang::Decl::isTemplateParameterPack(), and P.
Referenced by Create().
Definition at line 125 of file DeclTemplate.h.
References begin(), and end().
Referenced by clang::ODRHash::AddTemplateParameterList(), and getMinRequiredArguments().
Definition at line 128 of file DeclTemplate.h.
|
inline |
Definition at line 118 of file DeclTemplate.h.
Referenced by asArray(), clang::Sema::CheckTemplateArgumentList(), clang::Sema::CheckTemplateParameterList(), end(), clang::for(), clang::ASTContext::getCommentForDecl(), getParam(), TemplateParameterList(), and clang::Sema::TemplateParameterListsAreEqual().
|
inline |
Definition at line 119 of file DeclTemplate.h.
|
inline |
Determine whether this template parameter list contains an unexpanded parameter pack.
Definition at line 157 of file DeclTemplate.h.
|
static |
Definition at line 77 of file DeclTemplate.cpp.
References clang::ASTContext::Allocate(), and TemplateParameterList().
Referenced by clang::Sema::ActOnTemplateParameterList(), createMakeIntegerSeqParameterList(), clang::ASTContext::getCommentForDecl(), getGenericLambdaTemplateParameterList(), clang::TypeAliasTemplateDecl::getInstantiatedFromMemberTemplate(), clang::ASTNodeImporter::import(), clang::ClassTemplateDecl::isThisDeclarationADefinition(), clang::ASTReader::ReadTemplateParameterList(), clang::FunctionTemplateDecl::spec_end(), and clang::TemplateDeclInstantiator::SubstTemplateParams().
|
inline |
Definition at line 120 of file DeclTemplate.h.
References begin().
Referenced by asArray(), clang::Sema::CheckTemplateArgumentList(), clang::Sema::CheckTemplateParameterList(), clang::for(), clang::ASTContext::getCommentForDecl(), and clang::Sema::TemplateParameterListsAreEqual().
|
inline |
Definition at line 121 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 116 of file DeclTemplate.cpp.
References getParam(), and size().
Referenced by clang::TemplateTypeParmDecl::getDepth(), getParam(), hasDeducibleTemplateParameters(), isAtLeastAsSpecializedAs(), isSameAsPrimaryTemplate(), clang::Sema::MarkDeducedTemplateParameters(), and clang::TemplateTypeParmDecl::setDeclaredWithTypename().
|
inline |
Definition at line 172 of file DeclTemplate.h.
Referenced by clang::ASTRecordWriter::AddTemplateParameterList(), and clang::ASTNodeImporter::import().
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.
Referenced by getParam(), clang::Sema::isStdInitializerList(), and LookupStdInitializerList().
|
inline |
Definition at line 132 of file DeclTemplate.h.
References begin(), and size().
Referenced by checkLiteralOperatorTemplateParameterList(), clang::Sema::CheckTemplatePartialSpecializationArgs(), checkTupleLikeDecomposition(), getDepth(), clang::comments::TParamCommandComment::getParamName(), clang::Sema::getTemplateArgumentBindingsText(), isSameAsPrimaryTemplate(), isSameTemplateParameterList(), clang::Sema::isStdInitializerList(), LookupStdInitializerList(), noteNonDeducibleParameters(), and clang::Sema::RebuildTemplateParamsInCurrentInstantiation().
|
inline |
Definition at line 136 of file DeclTemplate.h.
References begin(), getDepth(), getMinRequiredArguments(), and size().
|
inline |
Definition at line 173 of file DeclTemplate.h.
Referenced by clang::ASTRecordWriter::AddTemplateParameterList(), DiagnoseTemplateParameterListArityMismatch(), and clang::ASTNodeImporter::import().
|
inline |
The constraint-expression of the associated requires-clause.
Definition at line 162 of file DeclTemplate.h.
Referenced by clang::formAssociatedConstraints(), clang::TemplateDecl::getRequiresClause(), and clang::ASTNodeImporter::import().
|
inline |
The constraint-expression of the associated requires-clause.
Definition at line 167 of file DeclTemplate.h.
|
inline |
Definition at line 175 of file DeclTemplate.h.
References print().
Referenced by checkLiteralOperatorTemplateParameterList(), clang::Sema::CheckTemplateDeclScope(), diagnoseMissingArgument(), clang::NonTypeTemplateParmDecl::getSourceRange(), clang::ClassTemplateSpecializationDecl::getTemplateKeywordLoc(), and clang::TemplateTypeParmDecl::setDeclaredWithTypename().
|
inline |
Definition at line 171 of file DeclTemplate.h.
Referenced by clang::ASTRecordWriter::AddTemplateParameterList(), clang::Sema::CheckTemplateDeclScope(), DiagnoseTemplateParameterListArityMismatch(), clang::TemplateDecl::getSourceRange(), clang::TemplateTemplateParmDecl::getSourceRange(), and clang::ASTNodeImporter::import().
|
inlineprotected |
Definition at line 92 of file DeclTemplate.h.
Referenced by clang::FunctionTemplateSpecializationInfo::getMemberSpecializationInfo().
|
inlineprotected |
Definition at line 96 of file DeclTemplate.h.
void TemplateParameterList::print | ( | raw_ostream & | Out, |
const ASTContext & | Context, | ||
bool | OmitTemplateKW = false |
||
) | const |
Definition at line 131 of file DeclPrinter.cpp.
Referenced by getSourceRange().
void TemplateParameterList::print | ( | raw_ostream & | Out, |
const ASTContext & | Context, | ||
const PrintingPolicy & | Policy, | ||
bool | OmitTemplateKW = false |
||
) | const |
Definition at line 136 of file DeclPrinter.cpp.
|
inline |
Definition at line 123 of file DeclTemplate.h.
Referenced by clang::ODRHash::AddTemplateParameterList(), clang::ASTRecordWriter::AddTemplateParameterList(), asArray(), clang::TemplateArgumentList::asArray(), checkLiteralOperatorTemplateParameterList(), clang::Sema::CheckTemplatePartialSpecializationArgs(), checkTupleLikeDecomposition(), clang::Sema::DeduceTemplateArguments(), DiagnoseTemplateParameterListArityMismatch(), clang::Sema::FindInstantiatedDecl(), clang::ASTContext::getCommentForDecl(), getDepth(), getFirstInnerIndex(), clang::ASTContext::getInjectedTemplateArgs(), getParam(), clang::Sema::getTemplateArgumentBindingsText(), hasDeducibleTemplateParameters(), clang::ASTNodeImporter::import(), isAtLeastAsSpecializedAs(), isSameAsPrimaryTemplate(), isSameTemplateParameterList(), clang::Sema::MarkDeducedTemplateParameters(), clang::Sema::RebuildTemplateParamsInCurrentInstantiation(), ResolveOverloadForDeduction(), clang::TemplateDeclInstantiator::SubstTemplateParams(), and clang::Sema::TemplateParameterListsAreEqual().
|
friend |
Definition at line 102 of file DeclTemplate.h.
friend clang::TemplateParameterList::TrailingObjects |
Definition at line 103 of file DeclTemplate.h.