class ClassTemplatePartialSpecializationDecl

Declaration

class ClassTemplatePartialSpecializationDecl
    : public ClassTemplateSpecializationDecl { /* full declaration omitted */ };

Description

Represents a class template specialization, which refers to a class template with a given set of template arguments. Class template specializations represent both explicit specialization of class templates, as in the example below, and implicit instantiations of class templates.

Declared at: clang/include/clang/AST/DeclTemplate.h:2101

Inherits from: ClassTemplateSpecializationDecl

Member Variables

private clang::TemplateParameterList* TemplateParams = nullptr
The list of template parameters
private const clang::ASTTemplateArgumentListInfo* ArgsAsWritten = nullptr
The source info for the template arguments as written. FIXME: redundant with TypeAsWritten?
private llvm::PointerIntPair< ClassTemplatePartialSpecializationDecl*, 1, bool> InstantiatedFromMember
The boolean value will be true to indicate that this class template partial specialization was specialized at this level.

Inherited from DeclContext:

protected
protected FirstDecl = nullptr
protected LastDecl = nullptr

Inherited from Decl:

protected NextInContextAndBits
protected Access
protected FromASTFile
protected IdentifierNamespace
protected CacheValidAndLinkage

Method Overview

  • private ClassTemplatePartialSpecializationDecl(clang::ASTContext & C)
  • private ClassTemplatePartialSpecializationDecl(clang::ASTContext & Context, clang::TagDecl::TagKind TK, clang::DeclContext * DC, clang::SourceLocation StartLoc, clang::SourceLocation IdLoc, clang::TemplateParameterList * Params, clang::ClassTemplateDecl * SpecializedTemplate, ArrayRef<clang::TemplateArgument> Args, const clang::ASTTemplateArgumentListInfo * ArgsAsWritten, clang::ClassTemplatePartialSpecializationDecl * PrevDecl)
  • public static clang::ClassTemplatePartialSpecializationDecl * Create(clang::ASTContext & Context, clang::TagDecl::TagKind TK, clang::DeclContext * DC, clang::SourceLocation StartLoc, clang::SourceLocation IdLoc, clang::TemplateParameterList * Params, clang::ClassTemplateDecl * SpecializedTemplate, ArrayRef<clang::TemplateArgument> Args, const clang::TemplateArgumentListInfo & ArgInfos, clang::QualType CanonInjectedType, clang::ClassTemplatePartialSpecializationDecl * PrevDecl)
  • public static clang::ClassTemplatePartialSpecializationDecl * CreateDeserialized(clang::ASTContext & C, unsigned int ID)
  • public static void Profile(llvm::FoldingSetNodeID & ID, ArrayRef<clang::TemplateArgument> TemplateArgs, clang::TemplateParameterList * TPL, clang::ASTContext & Context)
  • public void Profile(llvm::FoldingSetNodeID & ID) const
  • private void anchor()
  • public static bool classof(const clang::Decl * D)
  • public static bool classofKind(clang::Decl::Kind K)
  • public void getAssociatedConstraints(llvm::SmallVectorImpl<const Expr *> & AC) const
  • public clang::QualType getInjectedSpecializationType() const
  • public clang::ClassTemplatePartialSpecializationDecl * getInstantiatedFromMember() const
  • public clang::ClassTemplatePartialSpecializationDecl * getInstantiatedFromMemberTemplate() const
  • public clang::ClassTemplatePartialSpecializationDecl * getMostRecentDecl()
  • public const clang::ASTTemplateArgumentListInfo * getTemplateArgsAsWritten() const
  • public clang::TemplateParameterList * getTemplateParameters() const
  • public bool hasAssociatedConstraints() const
  • public bool isMemberSpecialization()
  • public void setInstantiatedFromMember(clang::ClassTemplatePartialSpecializationDecl * PartialSpec)
  • public void setMemberSpecialization()

Inherited from ClassTemplateSpecializationDecl:

Inherited from FoldingSetBase::Node:

Inherited from CXXRecordDecl:

Inherited from RecordDecl:

Inherited from TagDecl:

Inherited from DeclContext:

Inherited from TypeDecl:

Inherited from NamedDecl:

Inherited from Decl:

Methods

ClassTemplatePartialSpecializationDecl(
    clang::ASTContext& C)

Declared at: clang/include/clang/AST/DeclTemplate.h:2128

Parameters

clang::ASTContext& C

ClassTemplatePartialSpecializationDecl(
    clang::ASTContext& Context,
    clang::TagDecl::TagKind TK,
    clang::DeclContext* DC,
    clang::SourceLocation StartLoc,
    clang::SourceLocation IdLoc,
    clang::TemplateParameterList* Params,
    clang::ClassTemplateDecl* SpecializedTemplate,
    ArrayRef<clang::TemplateArgument> Args,
    const clang::ASTTemplateArgumentListInfo*
        ArgsAsWritten,
    clang::ClassTemplatePartialSpecializationDecl*
        PrevDecl)

Declared at: clang/include/clang/AST/DeclTemplate.h:2118

Parameters

clang::ASTContext& Context
clang::TagDecl::TagKind TK
clang::DeclContext* DC
clang::SourceLocation StartLoc
clang::SourceLocation IdLoc
clang::TemplateParameterList* Params
clang::ClassTemplateDecl* SpecializedTemplate
ArrayRef<clang::TemplateArgument> Args
const clang::ASTTemplateArgumentListInfo* ArgsAsWritten
clang::ClassTemplatePartialSpecializationDecl* PrevDecl

static clang::
    ClassTemplatePartialSpecializationDecl*
    Create(
        clang::ASTContext& Context,
        clang::TagDecl::TagKind TK,
        clang::DeclContext* DC,
        clang::SourceLocation StartLoc,
        clang::SourceLocation IdLoc,
        clang::TemplateParameterList* Params,
        clang::ClassTemplateDecl*
            SpecializedTemplate,
        ArrayRef<clang::TemplateArgument> Args,
        const clang::TemplateArgumentListInfo&
            ArgInfos,
        clang::QualType CanonInjectedType,
        clang::
            ClassTemplatePartialSpecializationDecl*
                PrevDecl)

Declared at: clang/include/clang/AST/DeclTemplate.h:2139

Parameters

clang::ASTContext& Context
clang::TagDecl::TagKind TK
clang::DeclContext* DC
clang::SourceLocation StartLoc
clang::SourceLocation IdLoc
clang::TemplateParameterList* Params
clang::ClassTemplateDecl* SpecializedTemplate
ArrayRef<clang::TemplateArgument> Args
const clang::TemplateArgumentListInfo& ArgInfos
clang::QualType CanonInjectedType
clang::ClassTemplatePartialSpecializationDecl* PrevDecl

static clang::
    ClassTemplatePartialSpecializationDecl*
    CreateDeserialized(clang::ASTContext& C,
                       unsigned int ID)

Declared at: clang/include/clang/AST/DeclTemplate.h:2149

Parameters

clang::ASTContext& C
unsigned int ID

static void Profile(
    llvm::FoldingSetNodeID& ID,
    ArrayRef<clang::TemplateArgument>
        TemplateArgs,
    clang::TemplateParameterList* TPL,
    clang::ASTContext& Context)

Declared at: clang/include/clang/AST/DeclTemplate.h:2262

Parameters

llvm::FoldingSetNodeID& ID
ArrayRef<clang::TemplateArgument> TemplateArgs
clang::TemplateParameterList* TPL
clang::ASTContext& Context

void Profile(llvm::FoldingSetNodeID& ID) const

Declared at: clang/include/clang/AST/DeclTemplate.h:2256

Parameters

llvm::FoldingSetNodeID& ID

void anchor()

Declared at: clang/include/clang/AST/DeclTemplate.h:2132

static bool classof(const clang::Decl* D)

Declared at: clang/include/clang/AST/DeclTemplate.h:2265

Parameters

const clang::Decl* D

static bool classofKind(clang::Decl::Kind K)

Declared at: clang/include/clang/AST/DeclTemplate.h:2267

Parameters

clang::Decl::Kind K

void getAssociatedConstraints(
    llvm::SmallVectorImpl<const Expr*>& AC) const

Description

All associated constraints of this partial specialization, including the requires clause and any constraints derived from constrained-parameters.

The constraints in the resulting list are to be treated as if in a conjunction ("and").

Declared at: clang/include/clang/AST/DeclTemplate.h:2168

Parameters

llvm::SmallVectorImpl<const Expr*>& AC

clang::QualType getInjectedSpecializationType()
    const

Description

Retrieves the injected specialization type for this partial specialization. This is not the same as the type-decl-type for this partial specialization, which is an InjectedClassNameType.

Declared at: clang/include/clang/AST/DeclTemplate.h:2250

clang::ClassTemplatePartialSpecializationDecl*
getInstantiatedFromMember() const

Description

Retrieve the member class template partial specialization from which this particular class template partial specialization was instantiated. In this example, the instantiation of \c Outer<float>::Inner<int*> will end up instantiating the partial specialization\c Outer<float>::Inner<U*>, which itself was instantiated from the class template partial specialization \c Outer<T>::Inner<U*>. Given\c Outer<float>::Inner<U*>, this function would return\c Outer<T>::Inner<U*>.

Declared at: clang/include/clang/AST/DeclTemplate.h:2201

clang::ClassTemplatePartialSpecializationDecl*
getInstantiatedFromMemberTemplate() const

Declared at: clang/include/clang/AST/DeclTemplate.h:2207

clang::ClassTemplatePartialSpecializationDecl*
getMostRecentDecl()

Declared at: clang/include/clang/AST/DeclTemplate.h:2151

const clang::ASTTemplateArgumentListInfo*
getTemplateArgsAsWritten() const

Description

Get the template arguments as written.

Declared at: clang/include/clang/AST/DeclTemplate.h:2177

clang::TemplateParameterList*
getTemplateParameters() const

Description

Get the list of template parameters

Declared at: clang/include/clang/AST/DeclTemplate.h:2158

bool hasAssociatedConstraints() const

Declared at: clang/include/clang/AST/DeclTemplate.h:2172

bool isMemberSpecialization()

Description

Determines whether this class template partial specialization template was a specialization of a member partial specialization. In the following example, the member template partial specialization\c X<int>::Inner<T*> is a member specialization.

Declared at: clang/include/clang/AST/DeclTemplate.h:2233

void setInstantiatedFromMember(
    clang::ClassTemplatePartialSpecializationDecl*
        PartialSpec)

Declared at: clang/include/clang/AST/DeclTemplate.h:2211

Parameters

clang::ClassTemplatePartialSpecializationDecl* PartialSpec

void setMemberSpecialization()

Description

Note that this member template is a specialization.

Declared at: clang/include/clang/AST/DeclTemplate.h:2240