class TemplateTypeParmType

Declaration

class TemplateTypeParmType : public Type, public Node { /* full declaration omitted */ };

Description

The base class of the type hierarchy. A central concept with types is that each type always has a canonical type. A canonical type is the type with any typedef names stripped out of it or the types it references. For example, consider: typedef int foo; typedef foo* bar; 'int *' 'foo *' 'bar' There will be a Type object created for 'int'. Since int is canonical, its CanonicalType pointer points to itself. There is also a Type for 'foo' (a TypedefType). Its CanonicalType pointer points to the 'int' Type. Next there is a PointerType that represents 'int*', which, like 'int', is canonical. Finally, there is a PointerType type for 'foo*' whose canonical type is 'int*', and there is a TypedefType for 'bar', whose canonical type is also 'int*'. Non-canonical types are useful for emitting diagnostics, without losing information about typedefs being used. Canonical types are useful for type comparisons (they allow by-pointer equality tests) and useful for reasoning about whether something has a particular form (e.g. is a function type), because they implicitly, recursively, strip all typedefs out of a type. Types, once created, are immutable.

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

Inherits from: Type, FoldingSetBase::Node

Member Variables

private anonymous struct / union

Inherited from Type:

protected

Method Overview

  • public void Profile(llvm::FoldingSetNodeID & ID)
  • public static void Profile(llvm::FoldingSetNodeID & ID, unsigned int Depth, unsigned int Index, bool ParameterPack, clang::TemplateTypeParmDecl * TTPDecl)
  • private TemplateTypeParmType(clang::TemplateTypeParmDecl * TTPDecl, clang::QualType Canon)
  • private TemplateTypeParmType(unsigned int D, unsigned int I, bool PP)
  • public static bool classof(const clang::Type * T)
  • public clang::QualType desugar() const
  • private const clang::TemplateTypeParmType::CanonicalTTPTInfo & getCanTTPTInfo() const
  • public clang::TemplateTypeParmDecl * getDecl() const
  • public unsigned int getDepth() const
  • public clang::IdentifierInfo * getIdentifier() const
  • public unsigned int getIndex() const
  • public bool isParameterPack() const
  • public bool isSugared() const

Inherited from FoldingSetBase::Node:

Inherited from Type:

Inherited from ExtQualsTypeCommonBase:

    Methods

    void Profile(llvm::FoldingSetNodeID& ID)

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

    Parameters

    llvm::FoldingSetNodeID& ID

    static void Profile(
        llvm::FoldingSetNodeID& ID,
        unsigned int Depth,
        unsigned int Index,
        bool ParameterPack,
        clang::TemplateTypeParmDecl* TTPDecl)

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

    Parameters

    llvm::FoldingSetNodeID& ID
    unsigned int Depth
    unsigned int Index
    bool ParameterPack
    clang::TemplateTypeParmDecl* TTPDecl

    TemplateTypeParmType(
        clang::TemplateTypeParmDecl* TTPDecl,
        clang::QualType Canon)

    Description

    Build a non-canonical type.

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

    Parameters

    clang::TemplateTypeParmDecl* TTPDecl
    clang::QualType Canon

    TemplateTypeParmType(unsigned int D,
                         unsigned int I,
                         bool PP)

    Description

    Build the canonical type.

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

    Parameters

    unsigned int D
    unsigned int I
    bool PP

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

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

    Parameters

    const clang::Type* T

    clang::QualType desugar() const

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

    const clang::TemplateTypeParmType::
        CanonicalTTPTInfo&
        getCanTTPTInfo() const

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

    clang::TemplateTypeParmDecl* getDecl() const

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

    unsigned int getDepth() const

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

    clang::IdentifierInfo* getIdentifier() const

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

    unsigned int getIndex() const

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

    bool isParameterPack() const

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

    bool isSugared() const

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