clang 20.0.0git
|
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. | |
using | const_iterator = NamedDecl *const * |
Iterates through the template parameters in this list. | |
Public Member Functions | |
void | Profile (llvm::FoldingSetNodeID &ID, const ASTContext &C) const |
iterator | begin () |
const_iterator | begin () const |
iterator | end () |
const_iterator | end () const |
unsigned | size () const |
bool | empty () 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. | |
unsigned | getDepth () const |
Get the depth of this template parameter list in the set of template parameter lists. | |
bool | containsUnexpandedParameterPack () const |
Determine whether this template parameter list contains an unexpanded parameter pack. | |
bool | hasParameterPack () const |
Determine whether this template parameter list contains a parameter pack. | |
Expr * | getRequiresClause () |
The constraint-expression of the associated requires-clause. | |
const Expr * | getRequiresClause () const |
The constraint-expression of the associated requires-clause. | |
void | getAssociatedConstraints (llvm::SmallVectorImpl< const Expr * > &AC) const |
All associated constraints derived from this template parameter list, including the requires clause and any constraints derived from constrained-parameters. | |
bool | hasAssociatedConstraints () const |
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) |
static bool | shouldIncludeTypeForArgument (const PrintingPolicy &Policy, const TemplateParameterList *TPL, unsigned Idx) |
Public Attributes | |
friend | TrailingObjects |
Protected Member Functions | |
TemplateParameterList (const ASTContext &C, 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 71 of file DeclTemplate.h.
using clang::TemplateParameterList::const_iterator = NamedDecl * const * |
Iterates through the template parameters in this list.
Definition at line 129 of file DeclTemplate.h.
using clang::TemplateParameterList::iterator = NamedDecl ** |
Iterates through the template parameters in this list.
Definition at line 126 of file DeclTemplate.h.
|
protected |
Definition at line 139 of file DeclTemplate.h.
References begin(), and end().
Referenced by clang::Sema::ActOnStartOfLambdaDefinition(), clang::ODRHash::AddTemplateParameterList(), argMatchesTemplateParams(), createTemplateSignatureString(), clang::ODRDiagsEmitter::diagnoseMismatch(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForRedeclarableTemplate(), GetTemplateArgs(), hasParameterPack(), clang::TemplateDeclInstantiator::VisitCXXMethodDecl(), and clang::TemplateDeclInstantiator::VisitFunctionDecl().
Definition at line 140 of file DeclTemplate.h.
|
inline |
Definition at line 131 of file DeclTemplate.h.
Referenced by clang::Sema::ActOnStartConceptDefinition(), AddTemplateParameterChunks(), asArray(), clang::Sema::CheckTemplateArgumentList(), clang::Sema::CheckTemplateParameterList(), end(), getParam(), substituteParameterMappings(), and clang::Sema::TemplateParameterListsAreEqual().
|
inline |
Definition at line 132 of file DeclTemplate.h.
bool clang::TemplateParameterList::containsUnexpandedParameterPack | ( | ) | const |
Determine whether this template parameter list contains an unexpanded parameter pack.
Referenced by clang::Sema::ActOnLambdaClosureParameters(), clang::concepts::ExprRequirement::ReturnTypeRequirement::containsUnexpandedParameterPack(), and clang::TemplateTemplateParmDecl::isPackExpansion().
|
static |
Referenced by clang::Sema::ActOnCompoundRequirement(), clang::Sema::ActOnFinishFunctionDeclarationDeclarator(), clang::Sema::ActOnTemplateParameterList(), createMakeIntegerSeqParameterList(), createTypePackElementParameterList(), clang::ASTNodeImporter::import(), clang::Sema::MatchTemplateParametersToScopeSpecifier(), clang::ASTRecordReader::readTemplateParameterList(), clang::TemplateDeclInstantiator::SubstTemplateParams(), clang::TemplateDeclInstantiator::VisitCXXMethodDecl(), and clang::TemplateDeclInstantiator::VisitFunctionDecl().
|
inline |
Definition at line 137 of file DeclTemplate.h.
Referenced by clang::Sema::ActOnStartFunctionDeclarationDeclarator().
|
inline |
Definition at line 133 of file DeclTemplate.h.
References begin().
Referenced by clang::Sema::ActOnStartConceptDefinition(), AddTemplateParameterChunks(), asArray(), clang::Sema::CheckTemplateArgumentList(), clang::Sema::CheckTemplateParameterList(), and clang::Sema::TemplateParameterListsAreEqual().
|
inline |
Definition at line 134 of file DeclTemplate.h.
References begin().
void clang::TemplateParameterList::getAssociatedConstraints | ( | llvm::SmallVectorImpl< const Expr * > & | AC | ) | const |
All associated constraints derived from this template parameter list, including the requires clause and any constraints derived from constrained-parameters.
The constraints in the resulting list are to be treated as if in a conjunction ("and").
Referenced by clang::Sema::CheckTemplateTemplateArgument(), clang::TemplateDecl::getAssociatedConstraints(), clang::ClassTemplatePartialSpecializationDecl::getAssociatedConstraints(), and clang::VarTemplatePartialSpecializationDecl::getAssociatedConstraints().
unsigned clang::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.
Referenced by clang::Sema::ActOnStartFunctionDeclarationDeclarator(), clang::Sema::BuildExprRequirement(), clang::Sema::CheckTemplateArgumentList(), clang::Sema::computeDeclContext(), hasDeducibleTemplateParameters(), isAtLeastAsSpecializedAs(), isSameAsPrimaryTemplate(), clang::Sema::isTemplateTemplateParameterAtLeastAsSpecializedAs(), clang::Sema::MarkDeducedTemplateParameters(), and CXXNameMangler::TemplateArgManglingInfo::needToMangleTemplateParam().
|
inline |
Definition at line 200 of file DeclTemplate.h.
Referenced by clang::Sema::ActOnFinishFunctionDeclarationDeclarator(), clang::Sema::ActOnTemplateTemplateParameter(), clang::ASTRecordWriter::AddTemplateParameterList(), clang::ASTNodeImporter::import(), clang::TemplateDeclInstantiator::SubstTemplateParams(), clang::TemplateDeclInstantiator::VisitCXXMethodDecl(), and clang::TemplateDeclInstantiator::VisitFunctionDecl().
unsigned clang::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.
Referenced by clang::Sema::CheckTypeConstraint(), clang::Sema::isStdInitializerList(), and LookupStdInitializerList().
Definition at line 144 of file DeclTemplate.h.
References begin(), and size().
Referenced by clang::Sema::ActOnClassTemplateSpecialization(), clang::comments::Sema::actOnTParamCommandParamNameArg(), argMatchesTemplateParams(), clang::Sema::BuildExprRequirement(), checkCUDADeviceBuiltinSurfaceClassTemplate(), checkCUDADeviceBuiltinTextureClassTemplate(), checkLiteralOperatorTemplateParameterList(), clang::Sema::CheckTemplatePartialSpecializationArgs(), checkTupleLikeDecomposition(), clang::PredefinedExpr::ComputeName(), ConvertDeducedTemplateArguments(), DeduceTemplateArguments(), DeduceTemplateArgumentsByTypeMatch(), clang::ODRDiagsEmitter::diagnoseMismatch(), DiagnoseUnexpandedParameterPacks(), FinishTemplateArgumentDeduction(), CXXNameMangler::TemplateArgManglingInfo::getArgInfo(), clang::CodeCompleteConsumer::OverloadCandidate::getParamDecl(), clang::comments::TParamCommandComment::getParamName(), clang::CodeCompleteConsumer::OverloadCandidate::getParamType(), clang::Sema::getTemplateArgumentBindingsText(), clang::SemaSYCL::handleKernelAttr(), clang::FunctionTemplateDecl::isAbbreviated(), isSameAsPrimaryTemplate(), clang::ASTContext::isSameTemplateParameterList(), clang::Sema::isStdInitializerList(), IsStructurallyEquivalent(), clang::Sema::LookupLiteralOperator(), LookupStdInitializerList(), noteNonDeducibleParameters(), clang::Sema::RebuildTemplateParamsInCurrentInstantiation(), clang::concepts::ExprRequirement::ReturnTypeRequirement::ReturnTypeRequirement(), clang::Sema::SubstituteExplicitTemplateArguments(), and clang::ASTNodeImporter::VisitFunctionTemplateDecl().
Definition at line 148 of file DeclTemplate.h.
|
inline |
Definition at line 201 of file DeclTemplate.h.
Referenced by clang::Sema::ActOnClassTemplateSpecialization(), clang::Sema::ActOnFinishFunctionDeclarationDeclarator(), clang::Sema::ActOnTemplateTemplateParameter(), clang::Sema::ActOnVariableDeclarator(), clang::ASTRecordWriter::AddTemplateParameterList(), DiagnoseTemplateParameterListArityMismatch(), clang::ASTNodeImporter::import(), clang::TemplateDeclInstantiator::SubstTemplateParams(), clang::TemplateDeclInstantiator::VisitCXXMethodDecl(), and clang::TemplateDeclInstantiator::VisitFunctionDecl().
|
inline |
The constraint-expression of the associated requires-clause.
Definition at line 180 of file DeclTemplate.h.
Referenced by clang::Sema::ActOnFinishFunctionDeclarationDeclarator(), clang::ASTRecordWriter::AddTemplateParameterList(), DeduceTemplateArguments(), clang::ASTNodeTraverser< Derived, NodeDelegateType >::dumpTemplateParameters(), CXXNameMangler::TemplateArgManglingInfo::getTrailingRequiresClauseToMangle(), clang::ASTNodeImporter::import(), clang::ASTContext::isSameTemplateParameterList(), clang::TemplateDeclInstantiator::SubstTemplateParams(), clang::Sema::TemplateParameterListsAreEqual(), clang::TemplateDeclInstantiator::VisitCXXMethodDecl(), and clang::TemplateDeclInstantiator::VisitFunctionDecl().
|
inline |
The constraint-expression of the associated requires-clause.
Definition at line 185 of file DeclTemplate.h.
|
inline |
|
inline |
Definition at line 199 of file DeclTemplate.h.
Referenced by clang::Sema::ActOnClassTemplateSpecialization(), clang::Sema::ActOnFinishFunctionDeclarationDeclarator(), clang::Sema::ActOnTag(), clang::Sema::ActOnVariableDeclarator(), clang::ASTRecordWriter::AddTemplateParameterList(), clang::Sema::CheckTemplateDeclScope(), DiagnoseTemplateParameterListArityMismatch(), clang::ClassTemplatePartialSpecializationDecl::getSourceRange(), clang::VarTemplatePartialSpecializationDecl::getSourceRange(), clang::ASTNodeImporter::import(), IsStructurallyEquivalent(), clang::TemplateDeclInstantiator::SubstTemplateParams(), clang::Sema::TemplateParameterListsAreEqual(), clang::TemplateDeclInstantiator::VisitCXXMethodDecl(), and clang::TemplateDeclInstantiator::VisitFunctionDecl().
bool clang::TemplateParameterList::hasAssociatedConstraints | ( | ) | const |
Referenced by clang::Sema::ActOnClassTemplateSpecialization(), clang::Sema::ActOnVarTemplateSpecialization(), clang::TemplateDecl::hasAssociatedConstraints(), clang::ClassTemplatePartialSpecializationDecl::hasAssociatedConstraints(), clang::VarTemplatePartialSpecializationDecl::hasAssociatedConstraints(), and IsOverloadOrOverrideImpl().
|
inline |
Determine whether this template parameter list contains a parameter pack.
Definition at line 172 of file DeclTemplate.h.
Referenced by argMatchesTemplateParams().
|
inlineprotected |
Definition at line 107 of file DeclTemplate.h.
|
inlineprotected |
Definition at line 103 of file DeclTemplate.h.
void clang::TemplateParameterList::print | ( | raw_ostream & | Out, |
const ASTContext & | Context, | ||
bool | OmitTemplateKW = false |
||
) | const |
void clang::TemplateParameterList::print | ( | raw_ostream & | Out, |
const ASTContext & | Context, | ||
const PrintingPolicy & | Policy, | ||
bool | OmitTemplateKW = false |
||
) | const |
void clang::TemplateParameterList::Profile | ( | llvm::FoldingSetNodeID & | ID, |
const ASTContext & | C | ||
) | const |
|
static |
|
inline |
Definition at line 136 of file DeclTemplate.h.
Referenced by clang::Sema::ActOnClassTemplateSpecialization(), clang::Sema::ActOnFunctionDeclarator(), clang::Sema::ActOnStartConceptDefinition(), clang::Sema::ActOnStartFunctionDeclarationDeclarator(), clang::Sema::ActOnTag(), clang::Sema::ActOnTemplateTemplateParameter(), clang::comments::Sema::actOnTParamCommandParamNameArg(), clang::Sema::ActOnVariableDeclarator(), clang::ASTRecordWriter::AddTemplateParameterList(), clang::ODRHash::AddTemplateParameterList(), argMatchesTemplateParams(), asArray(), clang::Sema::CheckClassTemplate(), checkCUDADeviceBuiltinSurfaceClassTemplate(), checkCUDADeviceBuiltinTextureClassTemplate(), checkLiteralOperatorTemplateParameterList(), clang::Sema::CheckTemplatePartialSpecializationArgs(), checkTupleLikeDecomposition(), clang::PredefinedExpr::ComputeName(), ConvertDeducedTemplateArguments(), clang::Sema::DeduceTemplateArguments(), DeduceTemplateArguments(), clang::Sema::DeduceTemplateArgumentsFromType(), DependsOnTemplateParameters(), clang::ODRDiagsEmitter::diagnoseMismatch(), DiagnoseTemplateParameterListArityMismatch(), DiagnoseUnexpandedParameterPacks(), clang::Sema::FindInstantiatedDecl(), FinishTemplateArgumentDeduction(), clang::RedeclarableTemplateDecl::getInjectedTemplateArgs(), clang::ASTContext::getInjectedTemplateArgs(), getMoreSpecialized(), clang::Sema::getMoreSpecializedTemplate(), getParam(), clang::Sema::getTemplateArgumentBindingsText(), clang::SemaSYCL::handleKernelAttr(), hasDeducibleTemplateParameters(), clang::ASTNodeImporter::import(), clang::FunctionTemplateDecl::isAbbreviated(), isAtLeastAsSpecializedAs(), isSameAsPrimaryTemplate(), clang::ASTContext::isSameTemplateParameterList(), IsStructurallyEquivalent(), clang::Sema::isTemplateTemplateParameterAtLeastAsSpecializedAs(), clang::Sema::LookupLiteralOperator(), clang::Sema::MarkDeducedTemplateParameters(), printTo(), clang::Sema::RebuildTemplateParamsInCurrentInstantiation(), ResolveOverloadForDeduction(), clang::concepts::ExprRequirement::ReturnTypeRequirement::ReturnTypeRequirement(), clang::Sema::SubstituteExplicitTemplateArguments(), substituteParameterMappings(), clang::TemplateDeclInstantiator::SubstTemplateParams(), clang::Sema::TemplateParameterListsAreEqual(), clang::TemplateDeclInstantiator::VisitCXXMethodDecl(), clang::TemplateDeclInstantiator::VisitFunctionDecl(), and clang::ASTNodeImporter::VisitFunctionTemplateDecl().
|
friend |
Definition at line 113 of file DeclTemplate.h.
friend clang::TemplateParameterList::TrailingObjects |
Definition at line 114 of file DeclTemplate.h.