class InjectedClassNameType

Declaration

class InjectedClassNameType : public Type { /* full declaration omitted */ };

Description

The injected class name of a C++ class template or class template partial specialization. Used to record that a type was spelled with a bare identifier rather than as a template-id; the equivalent for non-templated classes is just RecordType. Injected class name types are always dependent. Template instantiation turns these into RecordTypes. Injected class name types are always canonical. This works because it is impossible to compare an injected class name type with the corresponding non-injected template type, for the same reason that it is impossible to directly compare template parameters from different dependent contexts: injected class name types can only occur within the scope of a particular templated declaration, and within that scope every template specialization will canonicalize to the injected class name (when appropriate according to the rules of the language).

Declared at: clang/include/clang/AST/Type.h:5391

Inherits from: Type

Member Variables

private clang::CXXRecordDecl* Decl
private clang::QualType InjectedType
It is always unqualified, always a template specialization type, and always dependent.

Inherited from Type:

protected

Method Overview

Inherited from Type:

Inherited from ExtQualsTypeCommonBase:

    Methods

    InjectedClassNameType(clang::CXXRecordDecl* D,
                          clang::QualType TST)

    Declared at: clang/include/clang/AST/Type.h:5412

    Parameters

    clang::CXXRecordDecl* D
    clang::QualType TST

    static bool classof(const clang::Type* T)

    Declared at: clang/include/clang/AST/Type.h:5437

    Parameters

    const clang::Type* T

    clang::QualType desugar() const

    Declared at: clang/include/clang/AST/Type.h:5435

    clang::CXXRecordDecl* getDecl() const

    Declared at: clang/include/clang/AST/Type.h:5432

    clang::QualType getInjectedSpecializationType()
        const

    Declared at: clang/include/clang/AST/Type.h:5422

    const clang::TemplateSpecializationType*
    getInjectedTST() const

    Declared at: clang/include/clang/AST/Type.h:5424

    clang::TemplateName getTemplateName() const

    Declared at: clang/include/clang/AST/Type.h:5428

    bool isSugared() const

    Declared at: clang/include/clang/AST/Type.h:5434