class TemplateDeclInstantiator
Declaration
class TemplateDeclInstantiator : public DeclVisitor { /* full declaration omitted */ };
Description
A simple visitor class that helps create declaration visitors. This class does not preserve constness of Decl pointers (see also ConstDeclVisitor).
Declared at: clang/include/clang/Sema/Template.h:497
Inherits from: DeclVisitor
Member Variables
- private clang::Sema& SemaRef
- private Sema::ArgumentPackSubstitutionIndexRAII SubstIndex
- private clang::DeclContext* Owner
- private const clang::MultiLevelTemplateArgumentList& TemplateArgs
- private Sema::LateInstantiatedAttrVec* LateAttrs = nullptr
- private clang::LocalInstantiationScope* StartingScope = nullptr
- private SmallVector< std::pair< ClassTemplateDecl*, ClassTemplatePartialSpecializationDecl*>, 4> OutOfLinePartialSpecs
- A list of out-of-line class template partial specializations that will need to be instantiated after the enclosing class's instantiation is complete.
- private SmallVector< std::pair< VarTemplateDecl*, VarTemplatePartialSpecializationDecl*>, 4> OutOfLineVarPartialSpecs
- A list of out-of-line variable template partial specializations that will need to be instantiated after the enclosing variable's instantiation is complete. FIXME: Verify that this is needed.
Method Overview
- public bool InitFunctionInstantiation(clang::FunctionDecl * New, clang::FunctionDecl * Tmpl)
- public bool InitMethodInstantiation(clang::CXXMethodDecl * New, clang::CXXMethodDecl * Tmpl)
- public clang::ClassTemplatePartialSpecializationDecl * InstantiateClassTemplatePartialSpecialization(clang::ClassTemplateDecl * ClassTemplate, clang::ClassTemplatePartialSpecializationDecl * PartialSpec)
- public void InstantiateEnumDefinition(clang::EnumDecl * Enum, clang::EnumDecl * Pattern)
- public clang::Decl * InstantiateTypedefNameDecl(clang::TypedefNameDecl * D, bool IsTypeAlias)
- public clang::VarTemplatePartialSpecializationDecl * InstantiateVarTemplatePartialSpecialization(clang::VarTemplateDecl * VarTemplate, clang::VarTemplatePartialSpecializationDecl * PartialSpec)
- public bool SubstDefaultedFunction(clang::FunctionDecl * New, clang::FunctionDecl * Tmpl)
- public clang::TypeSourceInfo * SubstFunctionType(clang::FunctionDecl * D, SmallVectorImpl<clang::ParmVarDecl *> & Params)
- public bool SubstQualifier(const clang::TagDecl * OldDecl, clang::TagDecl * NewDecl)
- public bool SubstQualifier(const clang::DeclaratorDecl * OldDecl, clang::DeclaratorDecl * NewDecl)
- public clang::TemplateParameterList * SubstTemplateParams(clang::TemplateParameterList * List)
- public TemplateDeclInstantiator(clang::Sema & SemaRef, clang::DeclContext * Owner, const clang::MultiLevelTemplateArgumentList & TemplateArgs)
- public clang::Decl * VisitBaseUsingDecls(clang::BaseUsingDecl * D, clang::BaseUsingDecl * Inst, clang::LookupResult * Lookup)
- public clang::Decl * VisitCXXMethodDecl(clang::CXXMethodDecl * D, clang::TemplateParameterList * TemplateParams, Optional<const clang::ASTTemplateArgumentListInfo *> ClassScopeSpecializationArgs = llvm::None, clang::TemplateDeclInstantiator::RewriteKind RK = RewriteKind::None)
- public clang::Decl * VisitDecl(clang::Decl * D)
- public clang::Decl * VisitFunctionDecl(clang::FunctionDecl * D, clang::TemplateParameterList * TemplateParams, clang::TemplateDeclInstantiator::RewriteKind RK = RewriteKind::None)
- public clang::Decl * VisitVarDecl(clang::VarDecl * D, bool InstantiatingVarTemplate, ArrayRef<clang::BindingDecl *> * Bindings = nullptr)
- public clang::Decl * VisitVarTemplateSpecializationDecl(clang::VarTemplateDecl * VarTemplate, clang::VarDecl * FromVar, const clang::TemplateArgumentListInfo & TemplateArgsInfo, ArrayRef<clang::TemplateArgument> Converted, clang::VarTemplateSpecializationDecl * PrevDecl = nullptr)
- public void adjustForRewrite(clang::TemplateDeclInstantiator::RewriteKind RK, clang::FunctionDecl * Orig, clang::QualType & T, clang::TypeSourceInfo *& TInfo, clang::DeclarationNameInfo & NameInfo)
- public clang::TemplateDeclInstantiator::delayed_partial_spec_iterator delayed_partial_spec_begin()
- public clang::TemplateDeclInstantiator::delayed_partial_spec_iterator delayed_partial_spec_end()
- public clang::TemplateDeclInstantiator::delayed_var_partial_spec_iterator delayed_var_partial_spec_begin()
- public clang::TemplateDeclInstantiator::delayed_var_partial_spec_iterator delayed_var_partial_spec_end()
- public void disableLateAttributeInstantiation()
- public void enableLateAttributeInstantiation(Sema::LateInstantiatedAttrVec * LA)
- public clang::LocalInstantiationScope * getStartingScope() const
- private template <typename T>clang::Decl * instantiateUnresolvedUsingDecl(T * D, bool InstantiatingPackElement = false)
Methods
¶bool InitFunctionInstantiation(
clang::FunctionDecl* New,
clang::FunctionDecl* Tmpl)
bool InitFunctionInstantiation(
clang::FunctionDecl* New,
clang::FunctionDecl* Tmpl)
Declared at: clang/include/clang/Sema/Template.h:625
Parameters
- clang::FunctionDecl* New
- clang::FunctionDecl* Tmpl
¶bool InitMethodInstantiation(
clang::CXXMethodDecl* New,
clang::CXXMethodDecl* Tmpl)
bool InitMethodInstantiation(
clang::CXXMethodDecl* New,
clang::CXXMethodDecl* Tmpl)
Declared at: clang/include/clang/Sema/Template.h:626
Parameters
- clang::CXXMethodDecl* New
- clang::CXXMethodDecl* Tmpl
¶clang::ClassTemplatePartialSpecializationDecl*
InstantiateClassTemplatePartialSpecialization(
clang::ClassTemplateDecl* ClassTemplate,
clang::ClassTemplatePartialSpecializationDecl*
PartialSpec)
clang::ClassTemplatePartialSpecializationDecl*
InstantiateClassTemplatePartialSpecialization(
clang::ClassTemplateDecl* ClassTemplate,
clang::ClassTemplatePartialSpecializationDecl*
PartialSpec)
Declared at: clang/include/clang/Sema/Template.h:646
Parameters
- clang::ClassTemplateDecl* ClassTemplate
- clang::ClassTemplatePartialSpecializationDecl* PartialSpec
¶void InstantiateEnumDefinition(
clang::EnumDecl* Enum,
clang::EnumDecl* Pattern)
void InstantiateEnumDefinition(
clang::EnumDecl* Enum,
clang::EnumDecl* Pattern)
Declared at: clang/include/clang/Sema/Template.h:653
Parameters
- clang::EnumDecl* Enum
- clang::EnumDecl* Pattern
¶clang::Decl* InstantiateTypedefNameDecl(
clang::TypedefNameDecl* D,
bool IsTypeAlias)
clang::Decl* InstantiateTypedefNameDecl(
clang::TypedefNameDecl* D,
bool IsTypeAlias)
Declared at: clang/include/clang/Sema/Template.h:644
Parameters
- clang::TypedefNameDecl* D
- bool IsTypeAlias
¶clang::VarTemplatePartialSpecializationDecl*
InstantiateVarTemplatePartialSpecialization(
clang::VarTemplateDecl* VarTemplate,
clang::VarTemplatePartialSpecializationDecl*
PartialSpec)
clang::VarTemplatePartialSpecializationDecl*
InstantiateVarTemplatePartialSpecialization(
clang::VarTemplateDecl* VarTemplate,
clang::VarTemplatePartialSpecializationDecl*
PartialSpec)
Declared at: clang/include/clang/Sema/Template.h:650
Parameters
- clang::VarTemplateDecl* VarTemplate
- clang::VarTemplatePartialSpecializationDecl* PartialSpec
¶bool SubstDefaultedFunction(
clang::FunctionDecl* New,
clang::FunctionDecl* Tmpl)
bool SubstDefaultedFunction(
clang::FunctionDecl* New,
clang::FunctionDecl* Tmpl)
Declared at: clang/include/clang/Sema/Template.h:628
Parameters
- clang::FunctionDecl* New
- clang::FunctionDecl* Tmpl
¶clang::TypeSourceInfo* SubstFunctionType(
clang::FunctionDecl* D,
SmallVectorImpl<clang::ParmVarDecl*>& Params)
clang::TypeSourceInfo* SubstFunctionType(
clang::FunctionDecl* D,
SmallVectorImpl<clang::ParmVarDecl*>& Params)
Declared at: clang/include/clang/Sema/Template.h:623
Parameters
- clang::FunctionDecl* D
- SmallVectorImpl<clang::ParmVarDecl*>& Params
¶bool SubstQualifier(const clang::TagDecl* OldDecl,
clang::TagDecl* NewDecl)
bool SubstQualifier(const clang::TagDecl* OldDecl,
clang::TagDecl* NewDecl)
Declared at: clang/include/clang/Sema/Template.h:635
Parameters
- const clang::TagDecl* OldDecl
- clang::TagDecl* NewDecl
¶bool SubstQualifier(
const clang::DeclaratorDecl* OldDecl,
clang::DeclaratorDecl* NewDecl)
bool SubstQualifier(
const clang::DeclaratorDecl* OldDecl,
clang::DeclaratorDecl* NewDecl)
Declared at: clang/include/clang/Sema/Template.h:633
Parameters
- const clang::DeclaratorDecl* OldDecl
- clang::DeclaratorDecl* NewDecl
¶clang::TemplateParameterList* SubstTemplateParams(
clang::TemplateParameterList* List)
clang::TemplateParameterList* SubstTemplateParams(
clang::TemplateParameterList* List)
Declared at: clang/include/clang/Sema/Template.h:631
Parameters
¶TemplateDeclInstantiator(
clang::Sema& SemaRef,
clang::DeclContext* Owner,
const clang::MultiLevelTemplateArgumentList&
TemplateArgs)
TemplateDeclInstantiator(
clang::Sema& SemaRef,
clang::DeclContext* Owner,
const clang::MultiLevelTemplateArgumentList&
TemplateArgs)
Declared at: clang/include/clang/Sema/Template.h:523
Parameters
- clang::Sema& SemaRef
- clang::DeclContext* Owner
- const clang::MultiLevelTemplateArgumentList& TemplateArgs
¶clang::Decl* VisitBaseUsingDecls(
clang::BaseUsingDecl* D,
clang::BaseUsingDecl* Inst,
clang::LookupResult* Lookup)
clang::Decl* VisitBaseUsingDecls(
clang::BaseUsingDecl* D,
clang::BaseUsingDecl* Inst,
clang::LookupResult* Lookup)
Declared at: clang/include/clang/Sema/Template.h:574
Parameters
- clang::BaseUsingDecl* D
- clang::BaseUsingDecl* Inst
- clang::LookupResult* Lookup
¶clang::Decl* VisitCXXMethodDecl(
clang::CXXMethodDecl* D,
clang::TemplateParameterList* TemplateParams,
Optional<
const clang::ASTTemplateArgumentListInfo*>
ClassScopeSpecializationArgs = llvm::None,
clang::TemplateDeclInstantiator::RewriteKind
RK = RewriteKind::None)
clang::Decl* VisitCXXMethodDecl(
clang::CXXMethodDecl* D,
clang::TemplateParameterList* TemplateParams,
Optional<
const clang::ASTTemplateArgumentListInfo*>
ClassScopeSpecializationArgs = llvm::None,
clang::TemplateDeclInstantiator::RewriteKind
RK = RewriteKind::None)
Declared at: clang/include/clang/Sema/Template.h:563
Parameters
- clang::CXXMethodDecl* D
- clang::TemplateParameterList* TemplateParams
- Optional< const clang::ASTTemplateArgumentListInfo*> ClassScopeSpecializationArgs = llvm::None
- clang::TemplateDeclInstantiator::RewriteKind RK = RewriteKind::None
¶clang::Decl* VisitDecl(clang::Decl* D)
clang::Decl* VisitDecl(clang::Decl* D)
Declared at: clang/include/clang/Sema/Template.h:571
Parameters
- clang::Decl* D
¶clang::Decl* VisitFunctionDecl(
clang::FunctionDecl* D,
clang::TemplateParameterList* TemplateParams,
clang::TemplateDeclInstantiator::RewriteKind
RK = RewriteKind::None)
clang::Decl* VisitFunctionDecl(
clang::FunctionDecl* D,
clang::TemplateParameterList* TemplateParams,
clang::TemplateDeclInstantiator::RewriteKind
RK = RewriteKind::None)
Declared at: clang/include/clang/Sema/Template.h:568
Parameters
- clang::FunctionDecl* D
- clang::TemplateParameterList* TemplateParams
- clang::TemplateDeclInstantiator::RewriteKind RK = RewriteKind::None
¶clang::Decl* VisitVarDecl(
clang::VarDecl* D,
bool InstantiatingVarTemplate,
ArrayRef<clang::BindingDecl*>* Bindings =
nullptr)
clang::Decl* VisitVarDecl(
clang::VarDecl* D,
bool InstantiatingVarTemplate,
ArrayRef<clang::BindingDecl*>* Bindings =
nullptr)
Declared at: clang/include/clang/Sema/Template.h:572
Parameters
- clang::VarDecl* D
- bool InstantiatingVarTemplate
- ArrayRef<clang::BindingDecl*>* Bindings = nullptr
¶clang::Decl* VisitVarTemplateSpecializationDecl(
clang::VarTemplateDecl* VarTemplate,
clang::VarDecl* FromVar,
const clang::TemplateArgumentListInfo&
TemplateArgsInfo,
ArrayRef<clang::TemplateArgument> Converted,
clang::VarTemplateSpecializationDecl*
PrevDecl = nullptr)
clang::Decl* VisitVarTemplateSpecializationDecl(
clang::VarTemplateDecl* VarTemplate,
clang::VarDecl* FromVar,
const clang::TemplateArgumentListInfo&
TemplateArgsInfo,
ArrayRef<clang::TemplateArgument> Converted,
clang::VarTemplateSpecializationDecl*
PrevDecl = nullptr)
Declared at: clang/include/clang/Sema/Template.h:638
Parameters
- clang::VarTemplateDecl* VarTemplate
- clang::VarDecl* FromVar
- const clang::TemplateArgumentListInfo& TemplateArgsInfo
- ArrayRef<clang::TemplateArgument> Converted
- clang::VarTemplateSpecializationDecl* PrevDecl = nullptr
¶void adjustForRewrite(
clang::TemplateDeclInstantiator::RewriteKind
RK,
clang::FunctionDecl* Orig,
clang::QualType& T,
clang::TypeSourceInfo*& TInfo,
clang::DeclarationNameInfo& NameInfo)
void adjustForRewrite(
clang::TemplateDeclInstantiator::RewriteKind
RK,
clang::FunctionDecl* Orig,
clang::QualType& T,
clang::TypeSourceInfo*& TInfo,
clang::DeclarationNameInfo& NameInfo)
Declared at: clang/include/clang/Sema/Template.h:558
Parameters
- clang::TemplateDeclInstantiator::RewriteKind RK
- clang::FunctionDecl* Orig
- clang::QualType& T
- clang::TypeSourceInfo*& TInfo
- clang::DeclarationNameInfo& NameInfo
¶clang::TemplateDeclInstantiator::
delayed_partial_spec_iterator
delayed_partial_spec_begin()
clang::TemplateDeclInstantiator::
delayed_partial_spec_iterator
delayed_partial_spec_begin()
Description
Return an iterator to the beginning of the set of "delayed" partial specializations, which must be passed to InstantiateClassTemplatePartialSpecialization once the class definition has been completed.
Declared at: clang/include/clang/Sema/Template.h:602
¶clang::TemplateDeclInstantiator::
delayed_partial_spec_iterator
delayed_partial_spec_end()
clang::TemplateDeclInstantiator::
delayed_partial_spec_iterator
delayed_partial_spec_end()
Description
Return an iterator to the end of the set of "delayed" partial specializations, which must be passed to InstantiateClassTemplatePartialSpecialization once the class definition has been completed.
Declared at: clang/include/clang/Sema/Template.h:614
¶clang::TemplateDeclInstantiator::
delayed_var_partial_spec_iterator
delayed_var_partial_spec_begin()
clang::TemplateDeclInstantiator::
delayed_var_partial_spec_iterator
delayed_var_partial_spec_begin()
Declared at: clang/include/clang/Sema/Template.h:606
¶clang::TemplateDeclInstantiator::
delayed_var_partial_spec_iterator
delayed_var_partial_spec_end()
clang::TemplateDeclInstantiator::
delayed_var_partial_spec_iterator
delayed_var_partial_spec_end()
Declared at: clang/include/clang/Sema/Template.h:618
¶void disableLateAttributeInstantiation()
void disableLateAttributeInstantiation()
Declared at: clang/include/clang/Sema/Template.h:585
¶void enableLateAttributeInstantiation(
Sema::LateInstantiatedAttrVec* LA)
void enableLateAttributeInstantiation(
Sema::LateInstantiatedAttrVec* LA)
Declared at: clang/include/clang/Sema/Template.h:579
Parameters
¶clang::LocalInstantiationScope* getStartingScope()
const
clang::LocalInstantiationScope* getStartingScope()
const
Declared at: clang/include/clang/Sema/Template.h:590
¶template <typename T>
clang::Decl* instantiateUnresolvedUsingDecl(
T* D,
bool InstantiatingPackElement = false)
template <typename T>
clang::Decl* instantiateUnresolvedUsingDecl(
T* D,
bool InstantiatingPackElement = false)
Declared at: clang/include/clang/Sema/Template.h:657
Templates
- T
Parameters
- T* D
- bool InstantiatingPackElement = false