clang  6.0.0svn
Public Types | Public Member Functions | Public Attributes | List of all members
clang::Sema::CodeSynthesisContext Struct Reference

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"

Collaboration diagram for clang::Sema::CodeSynthesisContext:
Collaboration graph
[legend]

Public Types

enum  SynthesisKind {
  TemplateInstantiation, DefaultTemplateArgumentInstantiation, DefaultFunctionArgumentInstantiation, ExplicitTemplateArgumentSubstitution,
  DeducedTemplateArgumentSubstitution, PriorTemplateArgumentSubstitution, DefaultTemplateArgumentChecking, ExceptionSpecInstantiation,
  DeclaringSpecialMember, DefiningSynthesizedFunction
}
 The kind of template instantiation we are performing. More...
 

Public Member Functions

ArrayRef< TemplateArgumenttemplate_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...
 
DeclEntity
 The entity that is being synthesized. More...
 
NamedDeclTemplate
 The template (or partial specialization) in which we are performing the instantiation, for substitutions of prior template arguments. More...
 
const TemplateArgumentTemplateArgs
 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::TemplateDeductionInfoDeductionInfo
 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...
 

Detailed Description

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.

Definition at line 7057 of file Sema.h.

Member Enumeration Documentation

◆ SynthesisKind

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).

Definition at line 7059 of file Sema.h.

Constructor & Destructor Documentation

◆ CodeSynthesisContext()

clang::Sema::CodeSynthesisContext::CodeSynthesisContext ( )
inline

Definition at line 7150 of file Sema.h.

Member Function Documentation

◆ isInstantiationRecord()

bool Sema::CodeSynthesisContext::isInstantiationRecord ( ) const

◆ template_arguments()

ArrayRef<TemplateArgument> clang::Sema::CodeSynthesisContext::template_arguments ( ) const
inline

Definition at line 7136 of file Sema.h.

Member Data Documentation

◆ @225

union { ... }

◆ DeductionInfo

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 7143 of file Sema.h.

Referenced by isInstantiationRecord().

◆ Entity

Decl* clang::Sema::CodeSynthesisContext::Entity

The entity that is being synthesized.

Definition at line 7115 of file Sema.h.

Referenced by clang::Sema::SynthesizedFunctionScope::addContextNote(), and isInstantiationRecord().

◆ InstantiationRange

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 7148 of file Sema.h.

Referenced by isInstantiationRecord().

◆ Kind

enum clang::Sema::CodeSynthesisContext::SynthesisKind clang::Sema::CodeSynthesisContext::Kind

◆ NumTemplateArgs

unsigned clang::Sema::CodeSynthesisContext::NumTemplateArgs

The number of template arguments in TemplateArgs.

Definition at line 7130 of file Sema.h.

Referenced by isInstantiationRecord().

◆ PointOfInstantiation

SourceLocation clang::Sema::CodeSynthesisContext::PointOfInstantiation

The point of instantiation or synthesis within the source code.

Definition at line 7112 of file Sema.h.

Referenced by clang::Sema::SynthesizedFunctionScope::addContextNote(), and isInstantiationRecord().

◆ SavedInNonInstantiationSFINAEContext

bool clang::Sema::CodeSynthesisContext::SavedInNonInstantiationSFINAEContext

Was the enclosing context a non-instantiation SFINAE context?

Definition at line 7109 of file Sema.h.

Referenced by clang::Sema::pushCodeSynthesisContext().

◆ SpecialMember

CXXSpecialMember clang::Sema::CodeSynthesisContext::SpecialMember

The special member being declared or defined.

Definition at line 7133 of file Sema.h.

◆ Template

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 7120 of file Sema.h.

Referenced by isInstantiationRecord().

◆ TemplateArgs

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 7124 of file Sema.h.

Referenced by isInstantiationRecord().


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