clang  14.0.0git
Classes | Public Member Functions | List of all members
clang::Sema::InstantiatingTemplate Struct Reference

A stack object to be created when performing template instantiation. More...

#include "clang/Sema/Sema.h"

Classes

struct  ConstraintNormalization
 
struct  ConstraintsCheck
 
struct  ConstraintSubstitution
 
struct  ExceptionSpecification
 
struct  ParameterMappingSubstitution
 

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. More...
 
 InstantiatingTemplate (Sema &SemaRef, SourceLocation PointOfInstantiation, FunctionDecl *Entity, ExceptionSpecification, SourceRange InstantiationRange=SourceRange())
 Note that we are instantiating an exception specification of a function template. More...
 
 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. More...
 
 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. More...
 
 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. More...
 
 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. More...
 
 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. More...
 
 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. More...
 
 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. More...
 
 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. More...
 
 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. More...
 
 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). More...
 
 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. More...
 
 InstantiatingTemplate (Sema &SemaRef, SourceLocation PointOfInstantiation, ConstraintNormalization, NamedDecl *Template, SourceRange InstantiationRange)
 Note that we are normalizing a constraint expression. More...
 
 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. More...
 
 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. More...
 
 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. More...
 
void Clear ()
 Note that we have finished instantiating this template. More...
 
 ~InstantiatingTemplate ()
 
bool isInvalid () const
 Determines whether we have exceeded the maximum recursive template instantiations. More...
 
bool isAlreadyInstantiating () const
 Determine whether we are already instantiating this specialization in some surrounding active instantiation. More...
 

Detailed Description

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.

Definition at line 8946 of file Sema.h.

Constructor & Destructor Documentation

◆ InstantiatingTemplate() [1/17]

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 266 of file SemaTemplateInstantiate.cpp.

◆ InstantiatingTemplate() [2/17]

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 273 of file SemaTemplateInstantiate.cpp.

◆ InstantiatingTemplate() [3/17]

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 280 of file SemaTemplateInstantiate.cpp.

◆ InstantiatingTemplate() [4/17]

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 290 of file SemaTemplateInstantiate.cpp.

References clang::Sema::CodeSynthesisContext::DeducedTemplateArgumentSubstitution, and clang::Sema::CodeSynthesisContext::ExplicitTemplateArgumentSubstitution.

◆ InstantiatingTemplate() [5/17]

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 304 of file SemaTemplateInstantiate.cpp.

◆ InstantiatingTemplate() [6/17]

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 315 of file SemaTemplateInstantiate.cpp.

◆ InstantiatingTemplate() [7/17]

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 326 of file SemaTemplateInstantiate.cpp.

◆ InstantiatingTemplate() [8/17]

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 337 of file SemaTemplateInstantiate.cpp.

◆ InstantiatingTemplate() [9/17]

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 346 of file SemaTemplateInstantiate.cpp.

◆ InstantiatingTemplate() [10/17]

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 356 of file SemaTemplateInstantiate.cpp.

◆ InstantiatingTemplate() [11/17]

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 366 of file SemaTemplateInstantiate.cpp.

◆ InstantiatingTemplate() [12/17]

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 395 of file SemaTemplateInstantiate.cpp.

◆ InstantiatingTemplate() [13/17]

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 404 of file SemaTemplateInstantiate.cpp.

◆ InstantiatingTemplate() [14/17]

Sema::InstantiatingTemplate::InstantiatingTemplate ( Sema SemaRef,
SourceLocation  PointOfInstantiation,
ConstraintNormalization  ,
NamedDecl Template,
SourceRange  InstantiationRange 
)

Note that we are normalizing a constraint expression.

Definition at line 413 of file SemaTemplateInstantiate.cpp.

◆ InstantiatingTemplate() [15/17]

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 421 of file SemaTemplateInstantiate.cpp.

◆ InstantiatingTemplate() [16/17]

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 375 of file SemaTemplateInstantiate.cpp.

◆ InstantiatingTemplate() [17/17]

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 385 of file SemaTemplateInstantiate.cpp.

◆ ~InstantiatingTemplate()

clang::Sema::InstantiatingTemplate::~InstantiatingTemplate ( )
inline

Definition at line 9081 of file Sema.h.

References Clear().

Member Function Documentation

◆ Clear()

void Sema::InstantiatingTemplate::Clear ( )

◆ isAlreadyInstantiating()

bool clang::Sema::InstantiatingTemplate::isAlreadyInstantiating ( ) const
inline

Determine whether we are already instantiating this specialization in some surrounding active instantiation.

Definition at line 9089 of file Sema.h.

Referenced by clang::Sema::InstantiateDefaultArgument(), clang::Sema::InstantiateEnum(), clang::Sema::InstantiateExceptionSpec(), clang::Sema::InstantiateInClassInitializer(), and clang::Sema::InstantiateVariableDefinition().

◆ isInvalid()

bool clang::Sema::InstantiatingTemplate::isInvalid ( ) const
inline

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