clang 22.0.0git
|
A stack object to be created when performing template instantiation. More...
#include "clang/Sema/Sema.h"
Classes | |
struct | BuildingDeductionGuidesTag |
struct | ConstraintNormalization |
struct | ConstraintsCheck |
struct | ConstraintSubstitution |
struct | ExceptionSpecification |
struct | ParameterMappingSubstitution |
struct | PartialOrderingTTP |
Public Member Functions | |
InstantiatingTemplate (Sema &SemaRef, SourceLocation PointOfInstantiation, Decl *Entity, SourceRange InstantiationRange=SourceRange()) | |
Note that we are instantiating a class template, function template, variable template, alias template, or a member thereof. | |
InstantiatingTemplate (Sema &SemaRef, SourceLocation PointOfInstantiation, FunctionDecl *Entity, ExceptionSpecification, SourceRange InstantiationRange=SourceRange()) | |
Note that we are instantiating an exception specification of a function template. | |
InstantiatingTemplate (Sema &SemaRef, SourceLocation PointOfInstantiation, TypeAliasTemplateDecl *Entity, ArrayRef< TemplateArgument > TemplateArgs, SourceRange InstantiationRange=SourceRange()) | |
Note that we are instantiating a type alias template declaration. | |
InstantiatingTemplate (Sema &SemaRef, SourceLocation PointOfInstantiation, TemplateParameter Param, TemplateDecl *Template, ArrayRef< TemplateArgument > TemplateArgs, SourceRange InstantiationRange=SourceRange()) | |
Note that we are instantiating a default argument in a template-id. | |
InstantiatingTemplate (Sema &SemaRef, SourceLocation PointOfInstantiation, FunctionTemplateDecl *FunctionTemplate, ArrayRef< TemplateArgument > TemplateArgs, CodeSynthesisContext::SynthesisKind Kind, sema::TemplateDeductionInfo &DeductionInfo, SourceRange InstantiationRange=SourceRange()) | |
Note that we are substituting either explicitly-specified or deduced template arguments during function template argument deduction. | |
InstantiatingTemplate (Sema &SemaRef, SourceLocation PointOfInstantiation, TemplateDecl *Template, ArrayRef< TemplateArgument > TemplateArgs, sema::TemplateDeductionInfo &DeductionInfo, SourceRange InstantiationRange=SourceRange()) | |
Note that we are instantiating as part of template argument deduction for a class template declaration. | |
InstantiatingTemplate (Sema &SemaRef, SourceLocation PointOfInstantiation, ClassTemplatePartialSpecializationDecl *PartialSpec, ArrayRef< TemplateArgument > TemplateArgs, sema::TemplateDeductionInfo &DeductionInfo, SourceRange InstantiationRange=SourceRange()) | |
Note that we are instantiating as part of template argument deduction for a class template partial specialization. | |
InstantiatingTemplate (Sema &SemaRef, SourceLocation PointOfInstantiation, VarTemplatePartialSpecializationDecl *PartialSpec, ArrayRef< TemplateArgument > TemplateArgs, sema::TemplateDeductionInfo &DeductionInfo, SourceRange InstantiationRange=SourceRange()) | |
Note that we are instantiating as part of template argument deduction for a variable template partial specialization. | |
InstantiatingTemplate (Sema &SemaRef, SourceLocation PointOfInstantiation, ParmVarDecl *Param, ArrayRef< TemplateArgument > TemplateArgs, SourceRange InstantiationRange=SourceRange()) | |
Note that we are instantiating a default argument for a function parameter. | |
InstantiatingTemplate (Sema &SemaRef, SourceLocation PointOfInstantiation, NamedDecl *Template, NonTypeTemplateParmDecl *Param, ArrayRef< TemplateArgument > TemplateArgs, SourceRange InstantiationRange) | |
Note that we are substituting prior template arguments into a non-type parameter. | |
InstantiatingTemplate (Sema &SemaRef, SourceLocation PointOfInstantiation, NamedDecl *Template, TemplateTemplateParmDecl *Param, ArrayRef< TemplateArgument > TemplateArgs, SourceRange InstantiationRange) | |
Note that we are substituting prior template arguments into a template template parameter. | |
InstantiatingTemplate (Sema &SemaRef, SourceLocation PointOfInstantiation, TemplateDecl *Template, NamedDecl *Param, ArrayRef< TemplateArgument > TemplateArgs, SourceRange InstantiationRange) | |
Note that we are checking the default template argument against the template parameter for a given template-id. | |
InstantiatingTemplate (Sema &SemaRef, SourceLocation PointOfInstantiation, ConstraintsCheck, NamedDecl *Template, ArrayRef< TemplateArgument > TemplateArgs, SourceRange InstantiationRange) | |
Note that we are checking the constraints associated with some constrained entity (a concept declaration or a template with associated constraints). | |
InstantiatingTemplate (Sema &SemaRef, SourceLocation PointOfInstantiation, ConstraintSubstitution, NamedDecl *Template, sema::TemplateDeductionInfo &DeductionInfo, SourceRange InstantiationRange) | |
Note that we are checking a constraint expression associated with a template declaration or as part of the satisfaction check of a concept. | |
InstantiatingTemplate (Sema &SemaRef, SourceLocation PointOfInstantiation, ConstraintNormalization, NamedDecl *Template, SourceRange InstantiationRange) | |
Note that we are normalizing a constraint expression. | |
InstantiatingTemplate (Sema &SemaRef, SourceLocation PointOfInstantiation, ParameterMappingSubstitution, NamedDecl *Template, SourceRange InstantiationRange) | |
Note that we are subtituting into the parameter mapping of an atomic constraint during constraint normalization. | |
InstantiatingTemplate (Sema &SemaRef, SourceLocation PointOfInstantiation, concepts::Requirement *Req, sema::TemplateDeductionInfo &DeductionInfo, SourceRange InstantiationRange=SourceRange()) | |
Note that we are substituting template arguments into a part of a requirement of a requires expression. | |
InstantiatingTemplate (Sema &SemaRef, SourceLocation PointOfInstantiation, concepts::NestedRequirement *Req, ConstraintsCheck, SourceRange InstantiationRange=SourceRange()) | |
Note that we are checking the satisfaction of the constraint expression inside of a nested requirement. | |
InstantiatingTemplate (Sema &SemaRef, SourceLocation PointOfInstantiation, const RequiresExpr *E, sema::TemplateDeductionInfo &DeductionInfo, SourceRange InstantiationRange) | |
Note that we are checking a requires clause. | |
InstantiatingTemplate (Sema &SemaRef, SourceLocation PointOfInstantiation, TemplateDecl *Entity, BuildingDeductionGuidesTag, SourceRange InstantiationRange=SourceRange()) | |
Note that we are building deduction guides. | |
InstantiatingTemplate (Sema &SemaRef, SourceLocation ArgLoc, PartialOrderingTTP, TemplateDecl *PArg, SourceRange InstantiationRange=SourceRange()) | |
Note that we are partial ordering template template parameters. | |
void | Clear () |
Note that we have finished instantiating this template. | |
~InstantiatingTemplate () | |
bool | isInvalid () const |
Determines whether we have exceeded the maximum recursive template instantiations. | |
bool | isAlreadyInstantiating () const |
Determine whether we are already instantiating this specialization in some surrounding active instantiation. |
A stack object to be created when performing template instantiation.
Construction of an object of type InstantiatingTemplate
pushes the current instantiation onto the stack of active instantiations. If the size of this stack exceeds the maximum number of recursive template instantiations, construction produces an error and evaluates true.
Destruction of this object will pop the named instantiation off the stack.
Sema::InstantiatingTemplate::InstantiatingTemplate | ( | Sema & | SemaRef, |
SourceLocation | PointOfInstantiation, | ||
Decl * | Entity, | ||
SourceRange | InstantiationRange = SourceRange() ) |
Note that we are instantiating a class template, function template, variable template, alias template, or a member thereof.
Definition at line 646 of file SemaTemplateInstantiate.cpp.
References InstantiatingTemplate(), and clang::Sema::Sema().
Referenced by InstantiatingTemplate(), InstantiatingTemplate(), InstantiatingTemplate(), InstantiatingTemplate(), InstantiatingTemplate(), InstantiatingTemplate(), InstantiatingTemplate(), InstantiatingTemplate(), InstantiatingTemplate(), InstantiatingTemplate(), InstantiatingTemplate(), InstantiatingTemplate(), InstantiatingTemplate(), InstantiatingTemplate(), InstantiatingTemplate(), InstantiatingTemplate(), InstantiatingTemplate(), InstantiatingTemplate(), InstantiatingTemplate(), InstantiatingTemplate(), and InstantiatingTemplate().
Sema::InstantiatingTemplate::InstantiatingTemplate | ( | Sema & | SemaRef, |
SourceLocation | PointOfInstantiation, | ||
FunctionDecl * | Entity, | ||
ExceptionSpecification | , | ||
SourceRange | InstantiationRange = SourceRange() ) |
Note that we are instantiating an exception specification of a function template.
Definition at line 653 of file SemaTemplateInstantiate.cpp.
References InstantiatingTemplate(), and clang::Sema::Sema().
Sema::InstantiatingTemplate::InstantiatingTemplate | ( | Sema & | SemaRef, |
SourceLocation | PointOfInstantiation, | ||
TypeAliasTemplateDecl * | Entity, | ||
ArrayRef< TemplateArgument > | TemplateArgs, | ||
SourceRange | InstantiationRange = SourceRange() ) |
Note that we are instantiating a type alias template declaration.
Definition at line 746 of file SemaTemplateInstantiate.cpp.
References InstantiatingTemplate(), clang::nullptr, and clang::Sema::Sema().
Sema::InstantiatingTemplate::InstantiatingTemplate | ( | Sema & | SemaRef, |
SourceLocation | PointOfInstantiation, | ||
TemplateParameter | Param, | ||
TemplateDecl * | Template, | ||
ArrayRef< TemplateArgument > | TemplateArgs, | ||
SourceRange | InstantiationRange = SourceRange() ) |
Note that we are instantiating a default argument in a template-id.
Definition at line 660 of file SemaTemplateInstantiate.cpp.
References clang::getAsNamedDecl(), InstantiatingTemplate(), clang::Sema::Sema(), and clang::Template.
Sema::InstantiatingTemplate::InstantiatingTemplate | ( | Sema & | SemaRef, |
SourceLocation | PointOfInstantiation, | ||
FunctionTemplateDecl * | FunctionTemplate, | ||
ArrayRef< TemplateArgument > | TemplateArgs, | ||
CodeSynthesisContext::SynthesisKind | Kind, | ||
sema::TemplateDeductionInfo & | DeductionInfo, | ||
SourceRange | InstantiationRange = SourceRange() ) |
Note that we are substituting either explicitly-specified or deduced template arguments during function template argument deduction.
Definition at line 670 of file SemaTemplateInstantiate.cpp.
References clang::Sema::CodeSynthesisContext::BuildingDeductionGuides, clang::Sema::CodeSynthesisContext::DeducedTemplateArgumentSubstitution, clang::Sema::CodeSynthesisContext::ExplicitTemplateArgumentSubstitution, clang::Sema::FunctionTemplate, InstantiatingTemplate(), clang::nullptr, and clang::Sema::Sema().
Sema::InstantiatingTemplate::InstantiatingTemplate | ( | Sema & | SemaRef, |
SourceLocation | PointOfInstantiation, | ||
TemplateDecl * | Template, | ||
ArrayRef< TemplateArgument > | TemplateArgs, | ||
sema::TemplateDeductionInfo & | DeductionInfo, | ||
SourceRange | InstantiationRange = SourceRange() ) |
Note that we are instantiating as part of template argument deduction for a class template declaration.
Definition at line 684 of file SemaTemplateInstantiate.cpp.
References InstantiatingTemplate(), clang::nullptr, clang::Sema::Sema(), and clang::Template.
Sema::InstantiatingTemplate::InstantiatingTemplate | ( | Sema & | SemaRef, |
SourceLocation | PointOfInstantiation, | ||
ClassTemplatePartialSpecializationDecl * | PartialSpec, | ||
ArrayRef< TemplateArgument > | TemplateArgs, | ||
sema::TemplateDeductionInfo & | DeductionInfo, | ||
SourceRange | InstantiationRange = SourceRange() ) |
Note that we are instantiating as part of template argument deduction for a class template partial specialization.
Definition at line 695 of file SemaTemplateInstantiate.cpp.
References InstantiatingTemplate(), clang::nullptr, and clang::Sema::Sema().
Sema::InstantiatingTemplate::InstantiatingTemplate | ( | Sema & | SemaRef, |
SourceLocation | PointOfInstantiation, | ||
VarTemplatePartialSpecializationDecl * | PartialSpec, | ||
ArrayRef< TemplateArgument > | TemplateArgs, | ||
sema::TemplateDeductionInfo & | DeductionInfo, | ||
SourceRange | InstantiationRange = SourceRange() ) |
Note that we are instantiating as part of template argument deduction for a variable template partial specialization.
Definition at line 706 of file SemaTemplateInstantiate.cpp.
References InstantiatingTemplate(), clang::nullptr, and clang::Sema::Sema().
Sema::InstantiatingTemplate::InstantiatingTemplate | ( | Sema & | SemaRef, |
SourceLocation | PointOfInstantiation, | ||
ParmVarDecl * | Param, | ||
ArrayRef< TemplateArgument > | TemplateArgs, | ||
SourceRange | InstantiationRange = SourceRange() ) |
Note that we are instantiating a default argument for a function parameter.
Definition at line 717 of file SemaTemplateInstantiate.cpp.
References InstantiatingTemplate(), clang::nullptr, and clang::Sema::Sema().
Sema::InstantiatingTemplate::InstantiatingTemplate | ( | Sema & | SemaRef, |
SourceLocation | PointOfInstantiation, | ||
NamedDecl * | Template, | ||
NonTypeTemplateParmDecl * | Param, | ||
ArrayRef< TemplateArgument > | TemplateArgs, | ||
SourceRange | InstantiationRange ) |
Note that we are substituting prior template arguments into a non-type parameter.
Definition at line 726 of file SemaTemplateInstantiate.cpp.
References InstantiatingTemplate(), clang::Sema::Sema(), and clang::Template.
Sema::InstantiatingTemplate::InstantiatingTemplate | ( | Sema & | SemaRef, |
SourceLocation | PointOfInstantiation, | ||
NamedDecl * | Template, | ||
TemplateTemplateParmDecl * | Param, | ||
ArrayRef< TemplateArgument > | TemplateArgs, | ||
SourceRange | InstantiationRange ) |
Note that we are substituting prior template arguments into a template template parameter.
Definition at line 736 of file SemaTemplateInstantiate.cpp.
References InstantiatingTemplate(), clang::Sema::Sema(), and clang::Template.
Sema::InstantiatingTemplate::InstantiatingTemplate | ( | Sema & | SemaRef, |
SourceLocation | PointOfInstantiation, | ||
TemplateDecl * | Template, | ||
NamedDecl * | Param, | ||
ArrayRef< TemplateArgument > | TemplateArgs, | ||
SourceRange | InstantiationRange ) |
Note that we are checking the default template argument against the template parameter for a given template-id.
Definition at line 755 of file SemaTemplateInstantiate.cpp.
References InstantiatingTemplate(), clang::Sema::Sema(), and clang::Template.
Sema::InstantiatingTemplate::InstantiatingTemplate | ( | Sema & | SemaRef, |
SourceLocation | PointOfInstantiation, | ||
ConstraintsCheck | , | ||
NamedDecl * | Template, | ||
ArrayRef< TemplateArgument > | TemplateArgs, | ||
SourceRange | InstantiationRange ) |
Note that we are checking the constraints associated with some constrained entity (a concept declaration or a template with associated constraints).
Definition at line 790 of file SemaTemplateInstantiate.cpp.
References InstantiatingTemplate(), clang::nullptr, clang::Sema::Sema(), and clang::Template.
Sema::InstantiatingTemplate::InstantiatingTemplate | ( | Sema & | SemaRef, |
SourceLocation | PointOfInstantiation, | ||
ConstraintSubstitution | , | ||
NamedDecl * | Template, | ||
sema::TemplateDeductionInfo & | DeductionInfo, | ||
SourceRange | InstantiationRange ) |
Note that we are checking a constraint expression associated with a template declaration or as part of the satisfaction check of a concept.
Definition at line 799 of file SemaTemplateInstantiate.cpp.
References InstantiatingTemplate(), clang::nullptr, clang::Sema::Sema(), and clang::Template.
Sema::InstantiatingTemplate::InstantiatingTemplate | ( | Sema & | SemaRef, |
SourceLocation | PointOfInstantiation, | ||
ConstraintNormalization | , | ||
NamedDecl * | Template, | ||
SourceRange | InstantiationRange ) |
Note that we are normalizing a constraint expression.
Definition at line 808 of file SemaTemplateInstantiate.cpp.
References InstantiatingTemplate(), clang::Sema::Sema(), and clang::Template.
Sema::InstantiatingTemplate::InstantiatingTemplate | ( | Sema & | SemaRef, |
SourceLocation | PointOfInstantiation, | ||
ParameterMappingSubstitution | , | ||
NamedDecl * | Template, | ||
SourceRange | InstantiationRange ) |
Note that we are subtituting into the parameter mapping of an atomic constraint during constraint normalization.
Definition at line 816 of file SemaTemplateInstantiate.cpp.
References InstantiatingTemplate(), clang::Sema::Sema(), and clang::Template.
Sema::InstantiatingTemplate::InstantiatingTemplate | ( | Sema & | SemaRef, |
SourceLocation | PointOfInstantiation, | ||
concepts::Requirement * | Req, | ||
sema::TemplateDeductionInfo & | DeductionInfo, | ||
SourceRange | InstantiationRange = SourceRange() ) |
Note that we are substituting template arguments into a part of a requirement of a requires expression.
Definition at line 764 of file SemaTemplateInstantiate.cpp.
References InstantiatingTemplate(), clang::nullptr, and clang::Sema::Sema().
Sema::InstantiatingTemplate::InstantiatingTemplate | ( | Sema & | SemaRef, |
SourceLocation | PointOfInstantiation, | ||
concepts::NestedRequirement * | Req, | ||
ConstraintsCheck | , | ||
SourceRange | InstantiationRange = SourceRange() ) |
Note that we are checking the satisfaction of the constraint expression inside of a nested requirement.
Definition at line 773 of file SemaTemplateInstantiate.cpp.
References InstantiatingTemplate(), clang::nullptr, and clang::Sema::Sema().
Sema::InstantiatingTemplate::InstantiatingTemplate | ( | Sema & | SemaRef, |
SourceLocation | PointOfInstantiation, | ||
const RequiresExpr * | E, | ||
sema::TemplateDeductionInfo & | DeductionInfo, | ||
SourceRange | InstantiationRange ) |
Note that we are checking a requires clause.
Definition at line 782 of file SemaTemplateInstantiate.cpp.
References InstantiatingTemplate(), clang::nullptr, and clang::Sema::Sema().
Sema::InstantiatingTemplate::InstantiatingTemplate | ( | Sema & | SemaRef, |
SourceLocation | PointOfInstantiation, | ||
TemplateDecl * | Entity, | ||
BuildingDeductionGuidesTag | , | ||
SourceRange | InstantiationRange = SourceRange() ) |
Note that we are building deduction guides.
Definition at line 824 of file SemaTemplateInstantiate.cpp.
References InstantiatingTemplate(), and clang::Sema::Sema().
Sema::InstantiatingTemplate::InstantiatingTemplate | ( | Sema & | SemaRef, |
SourceLocation | ArgLoc, | ||
PartialOrderingTTP | , | ||
TemplateDecl * | PArg, | ||
SourceRange | InstantiationRange = SourceRange() ) |
Note that we are partial ordering template template parameters.
Definition at line 831 of file SemaTemplateInstantiate.cpp.
References InstantiatingTemplate(), and clang::Sema::Sema().
|
inline |
void Sema::InstantiatingTemplate::Clear | ( | ) |
Note that we have finished instantiating this template.
Definition at line 880 of file SemaTemplateInstantiate.cpp.
References clang::atTemplateEnd().
Referenced by getPatternForClassTemplateSpecialization(), and ~InstantiatingTemplate().
|
inline |
Determine whether we are already instantiating this specialization in some surrounding active instantiation.
Definition at line 13313 of file Sema.h.
Referenced by getPatternForClassTemplateSpecialization(), clang::Sema::InstantiateClass(), clang::Sema::InstantiateEnum(), clang::Sema::InstantiateExceptionSpec(), clang::Sema::InstantiateFunctionDefinition(), clang::Sema::InstantiateInClassInitializer(), clang::Sema::InstantiateVariableDefinition(), and clang::Sema::SubstDefaultArgument().
|
inline |
Determines whether we have exceeded the maximum recursive template instantiations.
Definition at line 13309 of file Sema.h.
Referenced by clang::Sema::BuildVarTemplateInstantiation(), CheckConstraintSatisfaction(), clang::Sema::CheckTemplateArgument(), clang::Sema::CheckTemplateArgumentList(), clang::Sema::CheckTemplateIdType(), ConvertDeducedTemplateArgument(), DeduceTemplateArguments(), clang::Sema::DeduceTemplateArgumentsFromType(), EvaluateAtomicConstraint(), clang::Sema::FinishTemplateArgumentDeduction(), getPatternForClassTemplateSpecialization(), clang::Sema::InstantiateClass(), clang::Sema::InstantiateEnum(), clang::Sema::InstantiateExceptionSpec(), instantiateExplicitSpecifierDeferred(), clang::Sema::InstantiateFunctionDeclaration(), clang::Sema::InstantiateFunctionDefinition(), clang::Sema::InstantiateInClassInitializer(), clang::TemplateDeclInstantiator::InstantiateTypeAliasTemplateDecl(), clang::Sema::InstantiateVariableDefinition(), isAtLeastAsSpecializedAs(), isAtLeastAsSpecializedAs(), clang::Sema::isTemplateTemplateParameterAtLeastAsSpecializedAs(), clang::Sema::SubstDefaultArgument(), SubstDefaultTemplateArgument(), SubstDefaultTemplateArgument(), SubstDefaultTemplateArgument(), SubstituteConstraintExpressionWithoutSatisfaction(), and clang::Sema::SubstituteExplicitTemplateArguments().