|
clang 23.0.0git
|
#include "clang/Sema/Template.h"
Public Types | |
| enum class | RewriteKind { None , RewriteSpaceshipAsEqualEqual } |
| using | delayed_partial_spec_iterator |
| using | delayed_var_partial_spec_iterator |
Definition at line 580 of file Template.h.
Definition at line 686 of file Template.h.
Definition at line 689 of file Template.h.
|
strong |
| Enumerator | |
|---|---|
| None | |
| RewriteSpaceshipAsEqualEqual | |
Definition at line 652 of file Template.h.
|
inline |
Definition at line 609 of file Template.h.
| void TemplateDeclInstantiator::adjustForRewrite | ( | RewriteKind | RK, |
| FunctionDecl * | Orig, | ||
| QualType & | T, | ||
| TypeSourceInfo *& | TInfo, | ||
| DeclarationNameInfo & | NameInfo ) |
Definition at line 4770 of file SemaTemplateInstantiateDecl.cpp.
References clang::TypeLoc::castAs(), clang::TypeLoc::getAsAdjusted(), clang::Decl::getEndLoc(), clang::TypeSourceInfo::getTypeLoc(), RewriteSpaceshipAsEqualEqual, clang::DeclarationNameInfo::setName(), and clang::FunctionTypeLoc::setParam().
Referenced by VisitCXXMethodDecl(), and VisitFunctionDecl().
|
inline |
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.
Definition at line 696 of file Template.h.
|
inline |
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.
Definition at line 708 of file Template.h.
|
inline |
Definition at line 700 of file Template.h.
|
inline |
Definition at line 712 of file Template.h.
|
inline |
Definition at line 679 of file Template.h.
|
inline |
Definition at line 673 of file Template.h.
|
inline |
Definition at line 617 of file Template.h.
|
inline |
Definition at line 684 of file Template.h.
| bool TemplateDeclInstantiator::InitFunctionInstantiation | ( | FunctionDecl * | New, |
| FunctionDecl * | Tmpl ) |
Initializes the common fields of an instantiation function declaration (New) from the corresponding fields of its template (Tmpl).
Definition at line 5413 of file SemaTemplateInstantiateDecl.cpp.
References clang::atTemplateBegin(), clang::atTemplateEnd(), clang::Definition, clang::EST_BasicNoexcept, clang::EST_DynamicNone, clang::EST_None, clang::EST_Unevaluated, clang::EST_Uninstantiated, clang::FunctionProtoType::ExtProtoInfo::ExceptionSpec, clang::Type::getAs(), clang::FunctionProtoType::getExtProtoInfo(), clang::FunctionType::getNoReturnAttr(), clang::FunctionProtoType::getParamTypes(), clang::FunctionType::getReturnType(), clang::ValueDecl::getType(), clang::FunctionProtoType::hasExceptionSpec(), clang::isa(), clang::FunctionDecl::isDefined(), clang::Decl::isImplicit(), clang::Decl::isInLocalScopeForInstantiation(), New, clang::FunctionProtoType::ExceptionSpecInfo::SourceDecl, clang::FunctionProtoType::ExceptionSpecInfo::SourceTemplate, and clang::FunctionProtoType::ExceptionSpecInfo::Type.
Referenced by InitMethodInstantiation(), and VisitFunctionDecl().
| bool TemplateDeclInstantiator::InitMethodInstantiation | ( | CXXMethodDecl * | New, |
| CXXMethodDecl * | Tmpl ) |
Initializes common fields of an instantiated method declaration (New) from the corresponding fields of its template (Tmpl).
Definition at line 5500 of file SemaTemplateInstantiateDecl.cpp.
References clang::cast(), clang::Decl::getAccess(), InitFunctionInstantiation(), clang::isa(), clang::FunctionDecl::isVirtualAsWritten(), and New.
Referenced by VisitCXXMethodDecl().
| ClassTemplatePartialSpecializationDecl * TemplateDeclInstantiator::InstantiateClassTemplatePartialSpecialization | ( | ClassTemplateDecl * | ClassTemplate, |
| ClassTemplatePartialSpecializationDecl * | PartialSpec ) |
Instantiate the declaration of a class template partial specialization.
| ClassTemplate | the (instantiated) class template that is partially |
| PartialSpec | the (uninstantiated) class template partial specialization that we are instantiating. |
Definition at line 4894 of file SemaTemplateInstantiateDecl.cpp.
References clang::ClassTemplateDecl::AddPartialSpecialization(), clang::ASTTemplateArgumentListInfo::arguments(), clang::Sema::CheckTemplateArgumentInfo::CanonicalConverted, clang::ClassTemplatePartialSpecializationDecl::Create(), clang::ClassTemplateDecl::findPartialSpecialization(), clang::TypeDecl::getBeginLoc(), clang::Decl::getLocation(), clang::TagDecl::getTagKind(), clang::ClassTemplateSpecializationDecl::getTemplateArgsAsWritten(), clang::ClassTemplatePartialSpecializationDecl::getTemplateParameters(), clang::ASTTemplateArgumentListInfo::LAngleLoc, clang::ASTTemplateArgumentListInfo::RAngleLoc, clang::ClassTemplatePartialSpecializationDecl::setInstantiatedFromMember(), clang::ClassTemplateSpecializationDecl::setTemplateArgsAsWritten(), clang::TemplateArgumentListInfo::size(), SubstQualifier(), and SubstTemplateParams().
Definition at line 2227 of file SemaTemplateInstantiateDecl.cpp.
References clang::Sema::ConstantEvaluated, clang::Enum, clang::EnumDecl::enumerators(), clang::Decl::getDeclContext(), clang::Decl::getLocation(), clang::DeclContext::isFunctionOrMethod(), isInvalid(), clang::Decl::setAccess(), clang::Decl::setInvalidDecl(), and clang::Unevaluated.
Referenced by clang::Sema::InstantiateEnum().
| Decl * TemplateDeclInstantiator::InstantiateTypeAliasTemplateDecl | ( | TypeAliasTemplateDecl * | D | ) |
Definition at line 1647 of file SemaTemplateInstantiateDecl.cpp.
References clang::TypeAliasTemplateDecl::Create(), clang::Found, clang::Decl::getAccess(), clang::Decl::getBeginLoc(), clang::NamedDecl::getDeclName(), clang::Decl::getLocation(), getPreviousDeclForInstantiation(), clang::TypeAliasTemplateDecl::getTemplatedDecl(), clang::TemplateDecl::getTemplateParameters(), InstantiateTypedefNameDecl(), clang::Sema::InstantiatingTemplate::isInvalid(), clang::Decl::setAccess(), clang::TypeAliasDecl::setDescribedAliasTemplate(), clang::RedeclarableTemplateDecl::setInstantiatedFromMemberTemplate(), clang::Redeclarable< decl_type >::setPreviousDecl(), and SubstTemplateParams().
| Decl * TemplateDeclInstantiator::InstantiateTypedefNameDecl | ( | TypedefNameDecl * | D, |
| bool | IsTypeAlias ) |
Definition at line 1551 of file SemaTemplateInstantiateDecl.cpp.
References clang::cast(), clang::Type::castAs(), clang::TypeAliasDecl::Create(), clang::TypedefDecl::Create(), clang::Decl::getAccess(), clang::Type::getAs(), clang::TypeDecl::getBeginLoc(), clang::Decl::getDeclContext(), clang::NamedDecl::getDeclName(), clang::NamedDecl::getIdentifier(), clang::Decl::getLocation(), clang::QualType::getNonReferenceType(), getPreviousDeclForInstantiation(), clang::TypeSourceInfo::getType(), clang::TagDecl::getTypedefNameForAnonDecl(), clang::TypedefNameDecl::getTypeSourceInfo(), clang::TypedefNameDecl::getUnderlyingType(), clang::TagDecl::hasNameForLinkage(), clang::Invalid, clang::isa(), clang::Type::isInstantiationDependentType(), clang::Decl::isReferenced(), clang::IdentifierInfo::isStr(), clang::Type::isVariablyModifiedType(), clang::TagDecl::setTypedefNameForAnonDecl(), and clang::Typedef.
Referenced by InstantiateTypeAliasTemplateDecl().
| VarTemplatePartialSpecializationDecl * TemplateDeclInstantiator::InstantiateVarTemplatePartialSpecialization | ( | VarTemplateDecl * | VarTemplate, |
| VarTemplatePartialSpecializationDecl * | PartialSpec ) |
Instantiate the declaration of a variable template partial specialization.
| VarTemplate | the (instantiated) variable template that is partially specialized by the instantiation of PartialSpec. |
| PartialSpec | the (uninstantiated) variable template partial specialization that we are instantiating. |
Definition at line 5004 of file SemaTemplateInstantiateDecl.cpp.
References clang::ASTTemplateArgumentListInfo::arguments(), clang::Sema::CheckTemplateArgumentInfo::CanonicalConverted, clang::VarTemplatePartialSpecializationDecl::Create(), clang::NamedDecl::getDeclName(), clang::DeclaratorDecl::getInnerLocStart(), clang::Decl::getLocation(), clang::VarDecl::getStorageClass(), clang::VarTemplateSpecializationDecl::getTemplateArgsAsWritten(), clang::VarTemplatePartialSpecializationDecl::getTemplateParameters(), clang::TypeSourceInfo::getType(), clang::DeclaratorDecl::getTypeSourceInfo(), clang::DeclaratorDecl::getTypeSpecStartLoc(), clang::Type::isFunctionType(), clang::VarDecl::isStaticDataMember(), clang::ASTTemplateArgumentListInfo::LAngleLoc, clang::ASTTemplateArgumentListInfo::RAngleLoc, clang::VarTemplatePartialSpecializationDecl::setInstantiatedFromMember(), clang::VarTemplateSpecializationDecl::setTemplateArgsAsWritten(), clang::TemplateArgumentListInfo::size(), SubstQualifier(), SubstTemplateParams(), and clang::VarTemplate.
|
inline |
Definition at line 614 of file Template.h.
Referenced by clang::Sema::SubstTemplateParams().
| bool TemplateDeclInstantiator::SubstDefaultedFunction | ( | FunctionDecl * | New, |
| FunctionDecl * | Tmpl ) |
Definition at line 5516 of file SemaTemplateInstantiateDecl.cpp.
References clang::FunctionDecl::DefaultedOrDeletedFunctionInfo::Create(), clang::Decl::getAccess(), clang::FunctionDecl::getDefaultedOrDeletedInfo(), clang::Decl::getLocation(), clang::DeclAccessPair::make(), and New.
Referenced by VisitCXXMethodDecl(), and VisitFunctionDecl().
| TypeSourceInfo * TemplateDeclInstantiator::SubstFunctionType | ( | FunctionDecl * | D, |
| SmallVectorImpl< ParmVarDecl * > & | Params ) |
Definition at line 5116 of file SemaTemplateInstantiateDecl.cpp.
References clang::cast(), clang::TypeLoc::castAs(), clang::TypeLoc::getAs(), clang::NamedDecl::getDeclName(), clang::Decl::getLocation(), clang::FunctionTypeLoc::getParam(), clang::FunctionProtoType::getParamType(), clang::ValueDecl::getType(), clang::TypeSourceInfo::getTypeLoc(), clang::DeclaratorDecl::getTypeSourceInfo(), clang::DeclaratorDecl::getTypeSpecStartLoc(), clang::TypeLoc::IgnoreParens(), clang::ValueDecl::isParameterPack(), clang::Method, and clang::FunctionDecl::parameters().
Referenced by VisitCXXMethodDecl(), and VisitFunctionDecl().
| bool TemplateDeclInstantiator::SubstQualifier | ( | const DeclaratorDecl * | OldDecl, |
| DeclaratorDecl * | NewDecl ) |
Definition at line 78 of file SemaTemplateInstantiateDecl.cpp.
Referenced by InstantiateClassTemplatePartialSpecialization(), and InstantiateVarTemplatePartialSpecialization().
Definition at line 83 of file SemaTemplateInstantiateDecl.cpp.
| TemplateParameterList * TemplateDeclInstantiator::SubstTemplateParams | ( | TemplateParameterList * | L | ) |
Instantiates a nested template parameter list in the current instantiation context.
| L | The parameter list to instantiate |
Definition at line 4846 of file SemaTemplateInstantiateDecl.cpp.
References clang::TemplateParameterList::Create(), clang::TemplateParameterList::getLAngleLoc(), clang::TemplateParameterList::getRAngleLoc(), clang::TemplateParameterList::getRequiresClause(), clang::TemplateParameterList::getTemplateLoc(), clang::Invalid, clang::Decl::isInvalidDecl(), clang::TemplateParameterList::size(), and clang::declvisitor::Base< std::add_pointer, TemplateDeclInstantiator, Decl * >::Visit().
Referenced by InstantiateClassTemplatePartialSpecialization(), InstantiateTypeAliasTemplateDecl(), InstantiateVarTemplatePartialSpecialization(), clang::Sema::SubstTemplateParams(), and VisitCXXMethodDecl().
| Decl * TemplateDeclInstantiator::VisitBaseUsingDecls | ( | BaseUsingDecl * | D, |
| BaseUsingDecl * | Inst, | ||
| LookupResult * | Lookup ) |
Definition at line 3938 of file SemaTemplateInstantiateDecl.cpp.
References clang::UnresolvedUsingIfExistsDecl::Create(), getPreviousDeclForInstantiation(), and clang::BaseUsingDecl::shadows().
| Decl * TemplateDeclInstantiator::VisitCXXMethodDecl | ( | CXXMethodDecl * | D, |
| TemplateParameterList * | TemplateParams, | ||
| RewriteKind | RK = RewriteKind::None ) |
Definition at line 3119 of file SemaTemplateInstantiateDecl.cpp.
References adjustForRewrite(), adjustFunctionTypeForInstantiation(), clang::CXXScopeSpec::Adopt(), clang::TemplateParameterList::asArray(), clang::cast(), clang::Constructor, clang::CXXConstructorDecl::Create(), clang::CXXConversionDecl::Create(), clang::CXXDestructorDecl::Create(), clang::CXXMethodDecl::Create(), clang::FunctionTemplateDecl::Create(), clang::TemplateParameterList::Create(), clang::TemplateArgumentList::CreateCopy(), clang::Sema::CodeSynthesisContext::DeducedTemplateArgumentSubstitution, clang::Destructor, clang::Decl::FOK_None, ForExternalRedeclaration, clang::FunctionTemplate, clang::ActionResult< PtrTy, Compress >::get(), clang::Decl::getAccess(), clang::Stmt::getBeginLoc(), clang::FunctionDecl::getConstexprKind(), clang::Decl::getDeclContext(), clang::FunctionDecl::getDeletedMessage(), clang::FunctionDecl::getDependentSpecializationInfo(), clang::FunctionDecl::getDescribedFunctionTemplate(), clang::Decl::getEndLoc(), clang::Stmt::getEndLoc(), clang::Decl::getFriendObjectKind(), clang::ExplicitSpecifier::getFromDecl(), clang::DeclaratorDecl::getInnerLocStart(), clang::TemplateParameterList::getLAngleLoc(), clang::Decl::getLexicalDeclContext(), clang::Decl::getLocation(), clang::FunctionDecl::getNameInfo(), clang::FunctionDecl::getPreviousDecl(), clang::DeclaratorDecl::getQualifierLoc(), clang::TemplateParameterList::getRAngleLoc(), clang::TemplateParameterList::getRequiresClause(), clang::TemplateParameterList::getTemplateLoc(), clang::DeclaratorDecl::getTemplateParameterLists(), clang::FunctionDecl::getTemplateSpecializationArgsAsWritten(), clang::DeclaratorDecl::getTrailingRequiresClause(), clang::Expr::getType(), clang::ValueDecl::getType(), clang::DeclaratorDecl::getTypeSourceInfo(), InitMethodInstantiation(), clang::isa(), clang::FunctionDecl::isDeletedAsWritten(), clang::FunctionDecl::isExplicitlyDefaulted(), clang::FunctionDecl::isInlined(), clang::FunctionDecl::isInlineSpecified(), clang::Decl::isInLocalScopeForInstantiation(), clang::isLambdaMethod(), clang::FunctionDecl::isOutOfLine(), clang::FunctionDecl::isPureVirtual(), clang::CXXMethodDecl::isStatic(), clang::ActionResult< PtrTy, Compress >::isUsable(), clang::Sema::LookupOrdinaryName, clang::Method, None, Previous, clang::SC_None, clang::SC_Static, clang::TemplateArgumentListInfo::setLAngleLoc(), clang::TemplateArgumentListInfo::setRAngleLoc(), clang::DeclaratorDecl::setTypeSourceInfo(), clang::TemplateParameterList::size(), SubstDefaultedFunction(), SubstFunctionType(), SubstTemplateParams(), clang::TSK_ImplicitInstantiation, clang::Unresolved, and clang::FunctionDecl::UsesFPIntrin().
Referenced by clang::Sema::SubstSpaceshipAsEqualEqual().
Definition at line 4753 of file SemaTemplateInstantiateDecl.cpp.
| Decl * TemplateDeclInstantiator::VisitFunctionDecl | ( | FunctionDecl * | D, |
| TemplateParameterList * | TemplateParams, | ||
| RewriteKind | FunctionRewriteKind = RewriteKind::None ) |
Normal class members are of more specific types and therefore don't make it here.
This function serves three purposes: 1) instantiating function templates 2) substituting friend and local function declarations 3) substituting deduction guide declarations for nested class templates
Definition at line 2733 of file SemaTemplateInstantiateDecl.cpp.
References adjustForRewrite(), adjustFunctionTypeForInstantiation(), clang::CXXScopeSpec::Adopt(), clang::TemplateParameterList::asArray(), clang::Sema::CodeSynthesisContext::BuildingDeductionGuides, clang::cast(), clang::CXXDeductionGuideDecl::Create(), clang::FunctionDecl::Create(), clang::FunctionTemplateDecl::Create(), clang::TemplateParameterList::Create(), clang::TemplateArgumentList::CreateCopy(), clang::Decl::FOK_None, ForExternalRedeclaration, clang::FunctionDecl::FriendConstraintRefersToEnclosingTemplate(), clang::Function, clang::FunctionTemplate, clang::ActionResult< PtrTy, Compress >::get(), clang::Decl::getAccess(), clang::Stmt::getBeginLoc(), clang::FunctionDecl::getCanonicalDecl(), clang::FunctionDecl::getConstexprKind(), clang::Decl::getDeclContext(), clang::FunctionDecl::getDeletedMessage(), clang::FunctionDecl::getDependentSpecializationInfo(), clang::FunctionDecl::getDescribedFunctionTemplate(), clang::SourceRange::getEnd(), clang::Stmt::getEndLoc(), clang::Decl::getFriendObjectKind(), clang::DeclaratorDecl::getInnerLocStart(), clang::TemplateParameterList::getLAngleLoc(), clang::Decl::getLocation(), clang::FunctionDecl::getNameInfo(), clang::DeclaratorDecl::getQualifierLoc(), clang::TemplateParameterList::getRAngleLoc(), clang::DeclContext::getRedeclContext(), clang::TemplateParameterList::getRequiresClause(), clang::FunctionDecl::getSourceRange(), clang::FunctionDecl::getStorageClass(), clang::TemplateParameterList::getTemplateLoc(), clang::FunctionDecl::getTemplateSpecializationArgsAsWritten(), clang::DeclaratorDecl::getTrailingRequiresClause(), clang::Expr::getType(), clang::FunctionDecl::hasBody(), clang::NestedNameSpecifierLoc::hasQualifier(), clang::FunctionDecl::hasWrittenPrototype(), clang::Decl::IDNS_Ordinary, InitFunctionInstantiation(), clang::isa(), clang::FunctionDecl::isDeleted(), clang::FunctionDecl::isDestroyingOperatorDelete(), clang::FunctionDecl::isExplicitlyDefaulted(), clang::DeclContext::isFileContext(), clang::Decl::isInIdentifierNamespace(), clang::FunctionDecl::isInlined(), clang::FunctionDecl::isInlineSpecified(), clang::ExplicitSpecifier::isInvalid(), clang::Decl::isLocalExternDecl(), clang::FunctionDecl::isOutOfLine(), clang::DeclContext::isRecord(), clang::FunctionDecl::isThisDeclarationADefinition(), clang::FunctionDecl::isTypeAwareOperatorNewOrDelete(), clang::ActionResult< PtrTy, Compress >::isUsable(), clang::Sema::LookupOrdinaryName, clang::Sema::LookupRedeclarationWithLinkage, clang::DeclContext::makeDeclVisibleInContext(), None, Previous, clang::TemplateArgumentListInfo::setLAngleLoc(), clang::Decl::setNonMemberOperator(), clang::TemplateArgumentListInfo::setRAngleLoc(), clang::TemplateParameterList::size(), SubstDefaultedFunction(), SubstFunctionType(), clang::Sema::TPC_FriendFunctionTemplate, clang::Sema::TPC_FriendFunctionTemplateDefinition, clang::TSK_ImplicitInstantiation, and clang::FunctionDecl::UsesFPIntrin().
Referenced by clang::Sema::SubstSpaceshipAsEqualEqual().
| Decl * TemplateDeclInstantiator::VisitVarDecl | ( | VarDecl * | D, |
| bool | InstantiatingVarTemplate, | ||
| ArrayRef< BindingDecl * > * | Bindings = nullptr ) |
Definition at line 1758 of file SemaTemplateInstantiateDecl.cpp.
References VisitVarDecl().
Referenced by VisitVarDecl().
| VarTemplateSpecializationDecl * TemplateDeclInstantiator::VisitVarTemplateSpecializationDecl | ( | VarTemplateDecl * | VarTemplate, |
| VarDecl * | FromVar, | ||
| ArrayRef< TemplateArgument > | Converted, | ||
| VarTemplateSpecializationDecl * | PrevDecl = nullptr ) |
Definition at line 4626 of file SemaTemplateInstantiateDecl.cpp.
References clang::Sema::CheckTemplateArgumentInfo::CanonicalConverted, clang::VarTemplateDecl::findSpecialization(), clang::Decl::getLocation(), clang::VarTemplateSpecializationDecl::getPointOfInstantiation(), clang::VarTemplateSpecializationDecl::getSpecializationKind(), clang::VarTemplateSpecializationDecl::getSpecializedTemplate(), clang::VarTemplateSpecializationDecl::getTemplateArgsAsWritten(), clang::TemplateArgumentListInfo::setLAngleLoc(), clang::TemplateArgumentListInfo::setRAngleLoc(), clang::VarTemplate, and VisitVarTemplateSpecializationDecl().
Referenced by clang::Sema::BuildVarTemplateInstantiation(), clang::Sema::InstantiateVariableDefinition(), and VisitVarTemplateSpecializationDecl().