|
clang 22.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< AssociatedConstraint > &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 |
| ArrayRef< TemplateArgument > | getInjectedTemplateArgs (const ASTContext &Context) |
| Get the template argument list of the template parameter list. | |
| 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 72 of file DeclTemplate.h.
| using clang::TemplateParameterList::const_iterator = NamedDecl * const * |
Iterates through the template parameters in this list.
Definition at line 133 of file DeclTemplate.h.
| using clang::TemplateParameterList::iterator = NamedDecl ** |
Iterates through the template parameters in this list.
Definition at line 130 of file DeclTemplate.h.
|
protected |
References clang::C.
Referenced by Create(), and shouldIncludeTypeForArgument().
Definition at line 143 of file DeclTemplate.h.
References begin(), and end().
Referenced by clang::Sema::ActOnStartOfLambdaDefinition(), clang::ODRHash::AddTemplateParameterList(), argMatchesTemplateParams(), createTemplateSignatureString(), DeduceTemplateArguments(), clang::ODRDiagsEmitter::diagnoseMismatch(), clang::ASTContext::getCanonicalTemplateName(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForRedeclarableTemplate(), GetTemplateArgs(), hasParameterPack(), clang::TemplateDeclInstantiator::VisitCXXMethodDecl(), and clang::TemplateDeclInstantiator::VisitFunctionDecl().
Definition at line 144 of file DeclTemplate.h.
|
inline |
Definition at line 135 of file DeclTemplate.h.
Referenced by clang::Sema::ActOnStartConceptDefinition(), AddTemplateParameterChunks(), asArray(), asArray(), clang::Sema::CheckTemplateArgumentList(), clang::Sema::CheckTemplateParameterList(), end(), end(), clang::ASTContext::getCanonicalTemplateTemplateParmDecl(), clang::CXXRecordDecl::getLambdaExplicitTemplateParameters(), getParam(), getParam(), and clang::Sema::TemplateParameterListsAreEqual().
|
inline |
Definition at line 136 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 |
References clang::C, and TemplateParameterList().
Referenced by clang::Sema::ActOnCompoundRequirement(), clang::Sema::ActOnFinishFunctionDeclarationDeclarator(), clang::Sema::ActOnTemplateParameterList(), constructBufferConceptDecl(), clang::hlsl::TemplateParameterListBuilder::finalizeTemplateArgs(), clang::ASTContext::getCanonicalTemplateTemplateParmDecl(), getGenericLambdaTemplateParameterList(), clang::ASTNodeImporter::import(), clang::Sema::MatchTemplateParametersToScopeSpecifier(), clang::ASTRecordReader::readTemplateParameterList(), clang::TemplateDeclInstantiator::SubstTemplateParams(), clang::TemplateDeclInstantiator::VisitCXXMethodDecl(), and clang::TemplateDeclInstantiator::VisitFunctionDecl().
|
inline |
Definition at line 141 of file DeclTemplate.h.
Referenced by clang::Sema::ActOnStartFunctionDeclarationDeclarator().
|
inline |
Definition at line 137 of file DeclTemplate.h.
References begin().
Referenced by clang::Sema::ActOnStartConceptDefinition(), AddTemplateParameterChunks(), asArray(), clang::Sema::CheckTemplateArgumentList(), clang::Sema::CheckTemplateParameterList(), clang::ASTContext::getCanonicalTemplateTemplateParmDecl(), clang::CXXRecordDecl::getLambdaExplicitTemplateParameters(), and clang::Sema::TemplateParameterListsAreEqual().
|
inline |
Definition at line 138 of file DeclTemplate.h.
References begin().
| void clang::TemplateParameterList::getAssociatedConstraints | ( | llvm::SmallVectorImpl< AssociatedConstraint > & | 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().
| 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(), FinishTemplateArgumentDeduction(), hasDeducibleTemplateParameters(), isSameAsPrimaryTemplate(), clang::Sema::isTemplateTemplateParameterAtLeastAsSpecializedAs(), clang::Sema::MarkDeducedTemplateParameters(), and CXXNameMangler::TemplateArgManglingInfo::needToMangleTemplateParam().
| ArrayRef< TemplateArgument > clang::TemplateParameterList::getInjectedTemplateArgs | ( | const ASTContext & | Context | ) |
Get the template argument list of the template parameter list.
Referenced by clang::RedeclarableTemplateDecl::getInjectedTemplateArgs(), clang::VarTemplatePartialSpecializationDecl::getInjectedTemplateArgs(), and clang::Sema::isTemplateTemplateParameterAtLeastAsSpecializedAs().
|
inline |
Definition at line 206 of file DeclTemplate.h.
Referenced by clang::Sema::ActOnFinishFunctionDeclarationDeclarator(), clang::Sema::ActOnTemplateTemplateParameter(), clang::ASTRecordWriter::AddTemplateParameterList(), FinishTemplateArgumentDeduction(), clang::ASTNodeImporter::import(), clang::Sema::isTemplateTemplateParameterAtLeastAsSpecializedAs(), 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 isStdClassTemplate(), and LookupStdClassTemplate().
Definition at line 146 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::CheckTemplateDeclScope(), clang::Sema::CheckTemplatePartialSpecializationArgs(), checkTupleLikeDecomposition(), clang::PredefinedExpr::ComputeName(), clang::hlsl::TemplateParameterListBuilder::constructConceptSpecializationExpr(), ConvertDeducedTemplateArguments(), DeduceTemplateArgumentsByTypeMatch(), clang::ODRDiagsEmitter::diagnoseMismatch(), DiagnoseUnexpandedParameterPacks(), FinishTemplateArgumentDeduction(), FinishTemplateArgumentDeduction(), clang::CodeCompleteConsumer::OverloadCandidate::getParamDecl(), clang::comments::TParamCommandComment::getParamName(), clang::CodeCompleteConsumer::OverloadCandidate::getParamType(), clang::getReplacedTemplateParameter(), clang::Sema::getTemplateArgumentBindingsText(), clang::SemaSYCL::handleKernelAttr(), clang::FunctionTemplateDecl::isAbbreviated(), isSameAsPrimaryTemplate(), clang::ASTContext::isSameTemplateParameterList(), isStdClassTemplate(), IsStructurallyEquivalent(), clang::Sema::isTemplateTemplateParameterAtLeastAsSpecializedAs(), clang::Sema::LookupLiteralOperator(), LookupStdClassTemplate(), noteNonDeducibleParameters(), clang::Sema::RebuildTemplateParamsInCurrentInstantiation(), clang::concepts::ExprRequirement::ReturnTypeRequirement::ReturnTypeRequirement(), clang::Sema::SubstituteExplicitTemplateArguments(), and clang::ASTNodeImporter::VisitFunctionTemplateDecl().
Definition at line 150 of file DeclTemplate.h.
|
inline |
Definition at line 207 of file DeclTemplate.h.
Referenced by clang::Sema::ActOnClassTemplateSpecialization(), clang::Sema::ActOnFinishFunctionDeclarationDeclarator(), clang::Sema::ActOnTemplateTemplateParameter(), clang::Sema::ActOnVariableDeclarator(), clang::ASTRecordWriter::AddTemplateParameterList(), DiagnoseTemplateParameterListArityMismatch(), FinishTemplateArgumentDeduction(), clang::ASTNodeImporter::import(), clang::Sema::isTemplateTemplateParameterAtLeastAsSpecializedAs(), clang::TemplateDeclInstantiator::SubstTemplateParams(), clang::TemplateDeclInstantiator::VisitCXXMethodDecl(), and clang::TemplateDeclInstantiator::VisitFunctionDecl().
|
inline |
The constraint-expression of the associated requires-clause.
Definition at line 182 of file DeclTemplate.h.
Referenced by clang::Sema::ActOnFinishFunctionDeclarationDeclarator(), clang::ASTRecordWriter::AddTemplateParameterList(), clang::ASTNodeTraverser< Derived, NodeDelegateType >::dumpTemplateParameters(), 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 187 of file DeclTemplate.h.
|
inline |
|
inline |
Definition at line 205 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::Sema::isTemplateTemplateParameterAtLeastAsSpecializedAs(), clang::TemplateDeclInstantiator::SubstTemplateParams(), clang::Sema::TemplateParameterListsAreEqual(), clang::TemplateDeclInstantiator::VisitCXXMethodDecl(), and clang::TemplateDeclInstantiator::VisitFunctionDecl().
| bool clang::TemplateParameterList::hasAssociatedConstraints | ( | ) | const |
|
inline |
Determine whether this template parameter list contains a parameter pack.
Definition at line 174 of file DeclTemplate.h.
References asArray().
Referenced by argMatchesTemplateParams().
|
inlineprotected |
Definition at line 111 of file DeclTemplate.h.
|
inlineprotected |
Definition at line 107 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 |
References clang::C.
Referenced by clang::ClassTemplatePartialSpecializationDecl::Profile(), and clang::VarTemplatePartialSpecializationDecl::Profile().
|
static |
References TemplateParameterList().
Referenced by clang::PredefinedExpr::ComputeName(), clang::Sema::getTemplateArgumentBindingsText(), printTemplateArgs(), and printTo().
|
inline |
Definition at line 140 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::CheckTemplateDeclScope(), clang::Sema::CheckTemplatePartialSpecializationArgs(), checkTupleLikeDecomposition(), clang::PredefinedExpr::ComputeName(), clang::hlsl::TemplateParameterListBuilder::constructConceptSpecializationExpr(), ConvertDeducedTemplateArguments(), clang::FriendTemplateDecl::Create(), clang::Sema::DeduceTemplateArguments(), clang::Sema::DeduceTemplateArguments(), clang::Sema::DeduceTemplateArguments(), clang::Sema::DeduceTemplateArgumentsFromType(), DependsOnTemplateParameters(), clang::ODRDiagsEmitter::diagnoseMismatch(), DiagnoseTemplateParameterListArityMismatch(), DiagnoseUnexpandedParameterPacks(), clang::Sema::FindInstantiatedDecl(), FinishTemplateArgumentDeduction(), clang::ASTContext::getCanonicalTemplateTemplateParmDecl(), getMoreSpecialized(), clang::Sema::getMoreSpecializedTemplate(), getParam(), getParam(), clang::Sema::getTemplateArgumentBindingsText(), clang::SemaSYCL::handleKernelAttr(), hasDeducibleTemplateParameters(), clang::ASTNodeImporter::import(), clang::FunctionTemplateDecl::isAbbreviated(), isAtLeastAsSpecializedAs(), isSameAsPrimaryTemplate(), clang::ASTContext::isSameTemplateParameterList(), IsStructurallyEquivalent(), clang::Sema::isTemplateTemplateParameterAtLeastAsSpecializedAs(), clang::TemplateTemplateParmDecl::isTypeConceptTemplateParam(), clang::Sema::LookupLiteralOperator(), clang::Sema::MarkDeducedTemplateParameters(), printTo(), clang::Sema::RebuildTemplateParamsInCurrentInstantiation(), ResolveOverloadForDeduction(), clang::concepts::ExprRequirement::ReturnTypeRequirement::ReturnTypeRequirement(), clang::Sema::SubstituteExplicitTemplateArguments(), clang::TemplateDeclInstantiator::SubstTemplateParams(), clang::Sema::TemplateParameterListsAreEqual(), clang::TemplateDeclInstantiator::VisitCXXMethodDecl(), clang::TemplateDeclInstantiator::VisitFunctionDecl(), and clang::ASTNodeImporter::VisitFunctionTemplateDecl().
|
friend |
Definition at line 117 of file DeclTemplate.h.
References FixedSizeTemplateParameterListStorage.
Referenced by FixedSizeTemplateParameterListStorage.
| friend clang::TemplateParameterList::TrailingObjects |
Definition at line 118 of file DeclTemplate.h.