class TemplateSpecializationType
Declaration
class TemplateSpecializationType : public Type, public Node { /* full declaration omitted */ };
Description
Represents a type template specialization; the template must be a class template, a type alias template, or a template template parameter. A template which cannot be resolved to one of these, e.g. because it is written with a dependent scope specifier, is instead represented as a@c DependentTemplateSpecializationType. A non-dependent template specialization type is always "sugar", typically for a \c RecordType. For example, a class template specialization type of \c vector<int> will refer to a tag type for the instantiation \c std::vector<int, std::allocator <int >> Template specializations are dependent if either the template or any of the template arguments are dependent, in which case the type may also be canonical. Instances of this type are allocated with a trailing array of TemplateArguments, followed by a QualType representing the non-canonical aliased type when the template is a type alias template.
Declared at: clang/include/clang/AST/Type.h:5238
Inherits from: Type, FoldingSetBase::Node
Member Variables
- private clang::TemplateName Template
- The name of the template being specialized. This is either a TemplateName::Template (in which case it is a ClassTemplateDecl*, a TemplateTemplateParmDecl*, or a TypeAliasTemplateDecl*), a TemplateName::SubstTemplateTemplateParmPack, or a TemplateName::SubstTemplateTemplateParm (in which case the replacement must, recursively, be one of these).
Inherited from Type:
Method Overview
- public static void Profile(llvm::FoldingSetNodeID & ID, clang::TemplateName T, ArrayRef<clang::TemplateArgument> Args, const clang::ASTContext & Context)
- public void Profile(llvm::FoldingSetNodeID & ID, const clang::ASTContext & Ctx)
- private TemplateSpecializationType(clang::TemplateName T, ArrayRef<clang::TemplateArgument> Args, clang::QualType Canon, clang::QualType Aliased)
- public static bool anyDependentTemplateArguments(ArrayRef<clang::TemplateArgumentLoc> Args, ArrayRef<clang::TemplateArgument> Converted)
- public static bool anyDependentTemplateArguments(const clang::TemplateArgumentListInfo &, ArrayRef<clang::TemplateArgument> Converted)
- public static bool anyInstantiationDependentTemplateArguments(ArrayRef<clang::TemplateArgumentLoc> Args)
- public clang::TemplateSpecializationType::iterator begin() const
- public static bool classof(const clang::Type * T)
- public clang::QualType desugar() const
- public clang::TemplateSpecializationType::iterator end() const
- public clang::QualType getAliasedType() const
- public const clang::TemplateArgument & getArg(unsigned int Idx) const
- public const clang::TemplateArgument * getArgs() const
- public unsigned int getNumArgs() const
- public clang::TemplateName getTemplateName() const
- public bool isCurrentInstantiation() const
- public bool isSugared() const
- public bool isTypeAlias() const
- public ArrayRef<clang::TemplateArgument> template_arguments() const
Inherited from FoldingSetBase::Node:
Inherited from Type:
- public acceptsObjCTypeParams
- protected addDependence
- public canDecayToPointerType
- public canHaveNullability
- public castAs
- public castAsArrayTypeUnsafe
- public containsErrors
- public containsUnexpandedParameterPack
- public dump
- public dump
- public getArrayElementTypeNoTypeQual
- public getAs
- public getAsAdjusted
- public getAsArrayTypeUnsafe
- public getAsCXXRecordDecl
- public getAsComplexIntegerType
- public getAsObjCInterfacePointerType
- public getAsObjCInterfaceType
- public getAsObjCQualifiedClassType
- public getAsObjCQualifiedIdType
- public getAsObjCQualifiedInterfaceType
- public getAsPlaceholderType
- public getAsRecordDecl
- public getAsStructureType
- public getAsTagDecl
- public getAsUnionType
- public getBaseElementTypeUnsafe
- public getCanonicalTypeInternal
- public getCanonicalTypeUnqualified
- public getContainedAutoType
- public getContainedDeducedType
- public getDependence
- public getLinkage
- public getLinkageAndVisibility
- public getLocallyUnqualifiedSingleStepDesugaredType
- public getNullability
- public getObjCARCImplicitLifetime
- public getObjCSubstitutions
- public getPointeeCXXRecordDecl
- public getPointeeOrArrayElementType
- public getPointeeType
- public getScalarTypeKind
- public getSveEltType
- public getTypeClass
- public getTypeClassName
- public getUnqualifiedDesugaredType
- public getVisibility
- public hasAttr
- public hasAutoForTrailingReturnType
- public hasFloatingRepresentation
- public hasIntegerRepresentation
- public hasObjCPointerRepresentation
- public hasPointerRepresentation
- public hasSignedIntegerRepresentation
- public hasSizedVLAType
- public hasUnnamedOrLocalType
- public hasUnsignedIntegerRepresentation
- public isAggregateType
- public isAlignValT
- public isAnyCharacterType
- public isAnyComplexType
- public isAnyPointerType
- public isArithmeticType
- public isArrayType
- public isAtomicType
- public isBFloat16Type
- public isBitIntType
- public isBlockCompatibleObjCPointerType
- public isBlockPointerType
- public isBooleanType
- public isBuiltinType
- public isCARCBridgableType
- public isCUDADeviceBuiltinSurfaceType
- public isCUDADeviceBuiltinTextureType
- public isCanonicalUnqualified
- public isChar16Type
- public isChar32Type
- public isChar8Type
- public isCharType
- public isClassType
- public isClkEventT
- public isComplexIntegerType
- public isComplexType
- public isCompoundType
- public isConstantArrayType
- public isConstantMatrixType
- public isConstantSizeType
- public isDecltypeType
- public isDependentAddressSpaceType
- public isDependentSizedArrayType
- public isDependentType
- public isElaboratedTypeSpecifier
- public isEnumeralType
- public isEventT
- public isExtVectorBoolType
- public isExtVectorType
- public isFixedPointOrIntegerType
- public isFixedPointType
- public isFloat128Type
- public isFloat16Type
- public isFloatingType
- public isFromAST
- public isFunctionNoProtoType
- public isFunctionPointerType
- public isFunctionProtoType
- public isFunctionReferenceType
- public isFunctionType
- public isFundamentalType
- public isHalfType
- public isIbm128Type
- public isImageType
- public isIncompleteArrayType
- public isIncompleteOrObjectType
- public isIncompleteType
- public isInstantiationDependentType
- public isIntegerType
- public isIntegralOrEnumerationType
- public isIntegralOrUnscopedEnumerationType
- public isIntegralType
- public isInterfaceType
- public isLValueReferenceType
- public isLinkageValid
- public isLiteralType
- public isMatrixType
- public isMemberDataPointerType
- public isMemberFunctionPointerType
- public isMemberPointerType
- public isNonOverloadPlaceholderType
- public isNothrowT
- public isNullPtrType
- public isOCLExtOpaqueType
- public isOCLIntelSubgroupAVCType
- public isObjCARCBridgableType
- public isObjCARCImplicitlyUnretainedType
- public isObjCBoxableRecordType
- public isObjCBuiltinType
- public isObjCClassOrClassKindOfType
- public isObjCClassType
- public isObjCIdOrObjectKindOfType
- public isObjCIdType
- public isObjCIndependentClassType
- public isObjCIndirectLifetimeType
- public isObjCInertUnsafeUnretainedType
- public isObjCLifetimeType
- public isObjCNSObjectType
- public isObjCObjectOrInterfaceType
- public isObjCObjectPointerType
- public isObjCObjectType
- public isObjCQualifiedClassType
- public isObjCQualifiedIdType
- public isObjCQualifiedInterfaceType
- public isObjCRetainableType
- public isObjCSelType
- public isObjectPointerType
- public isObjectType
- public isOpenCLSpecificType
- public isOverloadableType
- public isPipeType
- public isPlaceholderType
- public isPointerType
- public isPromotableIntegerType
- public isQueueT
- public isRValueReferenceType
- public isRealFloatingType
- public isRealType
- public isRecordType
- public isReferenceType
- public isReserveIDT
- public isSamplerT
- public isSaturatedFixedPointType
- public isScalarType
- public isScopedEnumeralType
- public isSignedFixedPointType
- public isSignedIntegerOrEnumerationType
- public isSignedIntegerType
- public isSizelessBuiltinType
- public isSizelessType
- public isSpecificBuiltinType
- public isSpecificPlaceholderType
- public isSpecifierType
- public isStandardLayoutType
- public isStdByteType
- public isStructuralType
- public isStructureOrClassType
- public isStructureType
- public isTemplateTypeParmType
- public isTypedefNameType
- public isUndeducedAutoType
- public isUndeducedType
- public isUnionType
- public isUnsaturatedFixedPointType
- public isUnscopedEnumerationType
- public isUnsignedFixedPointType
- public isUnsignedIntegerOrEnumerationType
- public isUnsignedIntegerType
- public isVLSTBuiltinType
- public isVariableArrayType
- public isVariablyModifiedType
- public isVectorType
- public isVisibilityExplicit
- public isVoidPointerType
- public isVoidType
- public isWideCharType
- protected setDependence
- protected this_
Inherited from ExtQualsTypeCommonBase:
Methods
¶static void Profile(
llvm::FoldingSetNodeID& ID,
clang::TemplateName T,
ArrayRef<clang::TemplateArgument> Args,
const clang::ASTContext& Context)
static void Profile(
llvm::FoldingSetNodeID& ID,
clang::TemplateName T,
ArrayRef<clang::TemplateArgument> Args,
const clang::ASTContext& Context)
Declared at: clang/include/clang/AST/Type.h:5348
Parameters
- llvm::FoldingSetNodeID& ID
- clang::TemplateName T
- ArrayRef<clang::TemplateArgument> Args
- const clang::ASTContext& Context
¶void Profile(llvm::FoldingSetNodeID& ID,
const clang::ASTContext& Ctx)
void Profile(llvm::FoldingSetNodeID& ID,
const clang::ASTContext& Ctx)
Declared at: clang/include/clang/AST/Type.h:5342
Parameters
- llvm::FoldingSetNodeID& ID
- const clang::ASTContext& Ctx
¶TemplateSpecializationType(
clang::TemplateName T,
ArrayRef<clang::TemplateArgument> Args,
clang::QualType Canon,
clang::QualType Aliased)
TemplateSpecializationType(
clang::TemplateName T,
ArrayRef<clang::TemplateArgument> Args,
clang::QualType Canon,
clang::QualType Aliased)
Declared at: clang/include/clang/AST/Type.h:5252
Parameters
- clang::TemplateName T
- ArrayRef<clang::TemplateArgument> Args
- clang::QualType Canon
- clang::QualType Aliased
¶static bool anyDependentTemplateArguments(
ArrayRef<clang::TemplateArgumentLoc> Args,
ArrayRef<clang::TemplateArgument> Converted)
static bool anyDependentTemplateArguments(
ArrayRef<clang::TemplateArgumentLoc> Args,
ArrayRef<clang::TemplateArgument> Converted)
Description
Determine whether any of the given template arguments are dependent. The converted arguments should be supplied when known; whether an argument is dependent can depend on the conversions performed on it (for example, a 'const int' passed as a template argument might be dependent if the parameter is a reference but non-dependent if the parameter is an int). Note that the \p Args parameter is unused: this is intentional, to remind the caller that they need to pass in the converted arguments, not the specified arguments.
Declared at: clang/include/clang/AST/Type.h:5270
Parameters
¶static bool anyDependentTemplateArguments(
const clang::TemplateArgumentListInfo&,
ArrayRef<clang::TemplateArgument> Converted)
static bool anyDependentTemplateArguments(
const clang::TemplateArgumentListInfo&,
ArrayRef<clang::TemplateArgument> Converted)
Declared at: clang/include/clang/AST/Type.h:5273
Parameters
- const clang::TemplateArgumentListInfo&
- ArrayRef<clang::TemplateArgument> Converted
¶static bool
anyInstantiationDependentTemplateArguments(
ArrayRef<clang::TemplateArgumentLoc> Args)
static bool
anyInstantiationDependentTemplateArguments(
ArrayRef<clang::TemplateArgumentLoc> Args)
Declared at: clang/include/clang/AST/Type.h:5275
Parameters
- ArrayRef<clang::TemplateArgumentLoc> Args
¶clang::TemplateSpecializationType::iterator
begin() const
clang::TemplateSpecializationType::iterator
begin() const
Declared at: clang/include/clang/AST/Type.h:5310
¶static bool classof(const clang::Type* T)
static bool classof(const clang::Type* T)
Declared at: clang/include/clang/AST/Type.h:5352
Parameters
- const clang::Type* T
¶clang::QualType desugar() const
clang::QualType desugar() const
Declared at: clang/include/clang/AST/Type.h:5338
¶clang::TemplateSpecializationType::iterator end()
const
clang::TemplateSpecializationType::iterator end()
const
Declared at: clang/include/clang/AST/Type.h:5311
¶clang::QualType getAliasedType() const
clang::QualType getAliasedType() const
Description
Get the aliased type, if this is a specialization of a type alias template.
Declared at: clang/include/clang/AST/Type.h:5303
¶const clang::TemplateArgument& getArg(
unsigned int Idx) const
const clang::TemplateArgument& getArg(
unsigned int Idx) const
Description
Retrieve a specific template argument as a type.
Declared at: clang/include/clang/AST/Type.h:5328
Parameters
- unsigned int Idx
¶const clang::TemplateArgument* getArgs() const
const clang::TemplateArgument* getArgs() const
Description
Retrieve the template arguments.
Declared at: clang/include/clang/AST/Type.h:5317
¶unsigned int getNumArgs() const
unsigned int getNumArgs() const
Description
Retrieve the number of template arguments.
Declared at: clang/include/clang/AST/Type.h:5322
¶clang::TemplateName getTemplateName() const
clang::TemplateName getTemplateName() const
Description
Retrieve the name of the template that we are specializing.
Declared at: clang/include/clang/AST/Type.h:5314
¶bool isCurrentInstantiation() const
bool isCurrentInstantiation() const
Description
True if this template specialization type matches a current instantiation in the context in which it is found.
Declared at: clang/include/clang/AST/Type.h:5280
¶bool isSugared() const
bool isSugared() const
Declared at: clang/include/clang/AST/Type.h:5334
¶bool isTypeAlias() const
bool isTypeAlias() const
Description
Determine if this template specialization type is for a type alias template that has been substituted. Nearly every template specialization type whose template is an alias template will be substituted. However, this is not the case when the specialization contains a pack expansion but the template alias does not have a corresponding parameter pack, e.g.,
Declared at: clang/include/clang/AST/Type.h:5299
¶ArrayRef<clang::TemplateArgument>
template_arguments() const
ArrayRef<clang::TemplateArgument>
template_arguments() const
Declared at: clang/include/clang/AST/Type.h:5330