clang 20.0.0git
|
A context in which code is being synthesized (where a source location alone is not sufficient to identify the context). More...
#include "clang/Sema/Sema.h"
Public Member Functions | |
ArrayRef< TemplateArgument > | template_arguments () const |
CodeSynthesisContext () | |
bool | isInstantiationRecord () const |
Determines whether this template is an actual instantiation that should be counted toward the maximum instantiation depth. | |
Public Attributes | |
enum clang::Sema::CodeSynthesisContext::SynthesisKind | Kind |
bool | SavedInNonInstantiationSFINAEContext |
Was the enclosing context a non-instantiation SFINAE context? | |
SourceLocation | PointOfInstantiation |
The point of instantiation or synthesis within the source code. | |
Decl * | Entity |
The entity that is being synthesized. | |
NamedDecl * | Template |
The template (or partial specialization) in which we are performing the instantiation, for substitutions of prior template arguments. | |
union { | |
const TemplateArgument * TemplateArgs | |
The list of template arguments we are substituting, if they are not part of the entity. More... | |
const Expr *const * CallArgs | |
The list of argument expressions in a synthesized call. More... | |
}; | |
union { | |
unsigned NumTemplateArgs | |
The number of template arguments in TemplateArgs. More... | |
unsigned NumCallArgs | |
The number of expressions in CallArgs. More... | |
CXXSpecialMemberKind SpecialMember | |
The special member being declared or defined. More... | |
}; | |
sema::TemplateDeductionInfo * | DeductionInfo |
The template deduction info object associated with the substitution or checking of explicit or deduced template arguments. | |
SourceRange | InstantiationRange |
The source range that covers the construct that cause the instantiation, e.g., the template-id that causes a class template instantiation. | |
A context in which code is being synthesized (where a source location alone is not sufficient to identify the context).
This covers template instantiation and various forms of implicitly-generated functions.
The kind of template instantiation we are performing.
Enumerator | |
---|---|
TemplateInstantiation | We are instantiating a template declaration. The entity is the declaration we're instantiating (e.g., a CXXRecordDecl). |
DefaultTemplateArgumentInstantiation | We are instantiating a default argument for a template parameter. The Entity is the template parameter whose argument is being instantiated, the Template is the template, and the TemplateArgs/NumTemplateArguments provide the template arguments as specified. |
DefaultFunctionArgumentInstantiation | We are instantiating a default argument for a function. The Entity is the ParmVarDecl, and TemplateArgs/NumTemplateArgs provides the template arguments as specified. |
ExplicitTemplateArgumentSubstitution | We are substituting explicit template arguments provided for a function template. The entity is a FunctionTemplateDecl. |
DeducedTemplateArgumentSubstitution | We are substituting template argument determined as part of template argument deduction for either a class template partial specialization or a function template. The Entity is either a {Class|Var}TemplatePartialSpecializationDecl or a TemplateDecl. |
LambdaExpressionSubstitution | We are substituting into a lambda expression. |
PriorTemplateArgumentSubstitution | We are substituting prior template arguments into a new template parameter. The template parameter itself is either a NonTypeTemplateParmDecl or a TemplateTemplateParmDecl. |
DefaultTemplateArgumentChecking | We are checking the validity of a default template argument that has been used when naming a template-id. |
ExceptionSpecEvaluation | We are computing the exception specification for a defaulted special member function. |
ExceptionSpecInstantiation | We are instantiating the exception specification for a function template which was deferred until it was needed. |
RequirementInstantiation | We are instantiating a requirement of a requires expression. |
NestedRequirementConstraintsCheck | We are checking the satisfaction of a nested requirement of a requires expression. |
DeclaringSpecialMember | We are declaring an implicit special member function. |
DeclaringImplicitEqualityComparison | We are declaring an implicit 'operator==' for a defaulted 'operator<=>'. |
DefiningSynthesizedFunction | We are defining a synthesized function (such as a defaulted special member). |
ConstraintsCheck | |
ConstraintSubstitution | |
ConstraintNormalization | |
RequirementParameterInstantiation | |
ParameterMappingSubstitution | |
RewritingOperatorAsSpaceship | We are rewriting a comparison operator in terms of an operator<=>. |
InitializingStructuredBinding | We are initializing a structured binding. |
MarkingClassDllexported | We are marking a class as __dllexport. |
BuildingBuiltinDumpStructCall | We are building an implied call from __builtin_dump_struct. The arguments are in CallArgs. |
Memoization | Added for Template instantiation observation. Memoization means we are not instantiating a template because it is already instantiated (but we entered a context where we would have had to if it was not already instantiated). |
BuildingDeductionGuides | We are building deduction guides for a class. |
TypeAliasTemplateInstantiation | We are instantiating a type alias template declaration. |
|
inline |
bool Sema::CodeSynthesisContext::isInstantiationRecord | ( | ) | const |
Determines whether this template is an actual instantiation that should be counted toward the maximum instantiation depth.
Definition at line 544 of file SemaTemplateInstantiate.cpp.
References BuildingBuiltinDumpStructCall, BuildingDeductionGuides, ConstraintNormalization, ConstraintsCheck, ConstraintSubstitution, DeclaringImplicitEqualityComparison, DeclaringSpecialMember, DeducedTemplateArgumentSubstitution, DefaultFunctionArgumentInstantiation, DefaultTemplateArgumentChecking, DefaultTemplateArgumentInstantiation, DefiningSynthesizedFunction, ExceptionSpecEvaluation, ExceptionSpecInstantiation, ExplicitTemplateArgumentSubstitution, InitializingStructuredBinding, Kind, LambdaExpressionSubstitution, MarkingClassDllexported, Memoization, NestedRequirementConstraintsCheck, ParameterMappingSubstitution, PriorTemplateArgumentSubstitution, RequirementInstantiation, RequirementParameterInstantiation, RewritingOperatorAsSpaceship, TemplateInstantiation, and TypeAliasTemplateInstantiation.
Referenced by clang::Sema::pushCodeSynthesisContext().
|
inline |
union { ... } clang::Sema::CodeSynthesisContext::@252 |
union { ... } clang::Sema::CodeSynthesisContext::@254 |
const Expr* const* clang::Sema::CodeSynthesisContext::CallArgs |
sema::TemplateDeductionInfo* clang::Sema::CodeSynthesisContext::DeductionInfo |
Decl* clang::Sema::CodeSynthesisContext::Entity |
The entity that is being synthesized.
Definition at line 12793 of file Sema.h.
Referenced by clang::Sema::SynthesizedFunctionScope::addContextNote(), clang::Sema::CreateOverloadedBinOp(), clang::Sema::DeclareImplicitEqualityComparison(), and ReferenceDllExportedMembers().
SourceRange clang::Sema::CodeSynthesisContext::InstantiationRange |
enum clang::Sema::CodeSynthesisContext::SynthesisKind clang::Sema::CodeSynthesisContext::Kind |
unsigned clang::Sema::CodeSynthesisContext::NumCallArgs |
unsigned clang::Sema::CodeSynthesisContext::NumTemplateArgs |
SourceLocation clang::Sema::CodeSynthesisContext::PointOfInstantiation |
The point of instantiation or synthesis within the source code.
Definition at line 12790 of file Sema.h.
Referenced by clang::Sema::SynthesizedFunctionScope::addContextNote(), clang::Sema::DeclareImplicitEqualityComparison(), clang::Sema::pushCodeSynthesisContext(), and ReferenceDllExportedMembers().
bool clang::Sema::CodeSynthesisContext::SavedInNonInstantiationSFINAEContext |
Was the enclosing context a non-instantiation SFINAE context?
Definition at line 12787 of file Sema.h.
Referenced by clang::Sema::pushCodeSynthesisContext().
CXXSpecialMemberKind clang::Sema::CodeSynthesisContext::SpecialMember |
NamedDecl* clang::Sema::CodeSynthesisContext::Template |
const TemplateArgument* clang::Sema::CodeSynthesisContext::TemplateArgs |