clang
7.0.0
|
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 Types | |
enum | SynthesisKind { TemplateInstantiation, DefaultTemplateArgumentInstantiation, DefaultFunctionArgumentInstantiation, ExplicitTemplateArgumentSubstitution, DeducedTemplateArgumentSubstitution, PriorTemplateArgumentSubstitution, DefaultTemplateArgumentChecking, ExceptionSpecInstantiation, DeclaringSpecialMember, DefiningSynthesizedFunction, Memoization } |
The kind of template instantiation we are performing. More... | |
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. More... | |
Public Attributes | |
enum clang::Sema::CodeSynthesisContext::SynthesisKind | Kind |
bool | SavedInNonInstantiationSFINAEContext |
Was the enclosing context a non-instantiation SFINAE context? More... | |
SourceLocation | PointOfInstantiation |
The point of instantiation or synthesis within the source code. More... | |
Decl * | Entity |
The entity that is being synthesized. More... | |
NamedDecl * | Template |
The template (or partial specialization) in which we are performing the instantiation, for substitutions of prior template arguments. More... | |
const TemplateArgument * | TemplateArgs |
The list of template arguments we are substituting, if they are not part of the entity. More... | |
union { | |
unsigned NumTemplateArgs | |
The number of template arguments in TemplateArgs. More... | |
CXXSpecialMember 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. More... | |
SourceRange | InstantiationRange |
The source range that covers the construct that cause the instantiation, e.g., the template-id that causes a class template instantiation. More... | |
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. |
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. |
ExceptionSpecInstantiation | We are instantiating the exception specification for a function template which was deferred until it was needed. |
DeclaringSpecialMember | We are declaring an implicit special member function. |
DefiningSynthesizedFunction | We are defining a synthesized function (such as a defaulted special member). |
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). |
|
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 188 of file SemaTemplateInstantiate.cpp.
References clang::atTemplateBegin(), DeductionInfo, clang::Sema::Diags, Entity, clang::Decl::getCanonicalDecl(), clang::DiagnosticsEngine::hasFatalErrorOccurred(), clang::DiagnosticsEngine::hasUncompilableErrorOccurred(), clang::Sema::InstantiatingSpecializations, clang::Sema::InstantiatingTemplate::InstantiatingTemplate(), InstantiationRange, Kind, NumTemplateArgs, PointOfInstantiation, clang::Sema::pushCodeSynthesisContext(), Template, TemplateArgs, and clang::Sema::TemplateInstCallbacks.
Referenced by clang::Sema::pushCodeSynthesisContext().
|
inline |
union { ... } |
sema::TemplateDeductionInfo* clang::Sema::CodeSynthesisContext::DeductionInfo |
The template deduction info object associated with the substitution or checking of explicit or deduced template arguments.
Definition at line 7224 of file Sema.h.
Referenced by isInstantiationRecord().
Decl* clang::Sema::CodeSynthesisContext::Entity |
The entity that is being synthesized.
Definition at line 7196 of file Sema.h.
Referenced by clang::Sema::SynthesizedFunctionScope::addContextNote(), and isInstantiationRecord().
SourceRange clang::Sema::CodeSynthesisContext::InstantiationRange |
The source range that covers the construct that cause the instantiation, e.g., the template-id that causes a class template instantiation.
Definition at line 7229 of file Sema.h.
Referenced by isInstantiationRecord().
enum clang::Sema::CodeSynthesisContext::SynthesisKind clang::Sema::CodeSynthesisContext::Kind |
Referenced by clang::Sema::SynthesizedFunctionScope::addContextNote(), and isInstantiationRecord().
unsigned clang::Sema::CodeSynthesisContext::NumTemplateArgs |
The number of template arguments in TemplateArgs.
Definition at line 7211 of file Sema.h.
Referenced by isInstantiationRecord().
SourceLocation clang::Sema::CodeSynthesisContext::PointOfInstantiation |
The point of instantiation or synthesis within the source code.
Definition at line 7193 of file Sema.h.
Referenced by clang::Sema::SynthesizedFunctionScope::addContextNote(), and isInstantiationRecord().
bool clang::Sema::CodeSynthesisContext::SavedInNonInstantiationSFINAEContext |
Was the enclosing context a non-instantiation SFINAE context?
Definition at line 7190 of file Sema.h.
Referenced by clang::Sema::pushCodeSynthesisContext().
CXXSpecialMember clang::Sema::CodeSynthesisContext::SpecialMember |
NamedDecl* clang::Sema::CodeSynthesisContext::Template |
The template (or partial specialization) in which we are performing the instantiation, for substitutions of prior template arguments.
Definition at line 7201 of file Sema.h.
Referenced by isInstantiationRecord().
const TemplateArgument* clang::Sema::CodeSynthesisContext::TemplateArgs |
The list of template arguments we are substituting, if they are not part of the entity.
Definition at line 7205 of file Sema.h.
Referenced by isInstantiationRecord().