class TagType

Declaration

class TagType : public Type { /* 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:4682

Inherits from: Type

Member Variables

private clang::TagDecl* decl
Stores the TagDecl associated with this type. The decl may point to any TagDecl that declares the entity.

Inherited from Type:

protected

Method Overview

  • protected TagType(clang::Type::TypeClass TC, const clang::TagDecl * D, clang::QualType can)
  • public static bool classof(const clang::Type * T)
  • public clang::TagDecl * getDecl() const
  • public bool isBeingDefined() const

Inherited from Type:

Inherited from ExtQualsTypeCommonBase:

    Methods

    TagType(clang::Type::TypeClass TC,
            const clang::TagDecl* D,
            clang::QualType can)

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

    Parameters

    clang::Type::TypeClass TC
    const clang::TagDecl* D
    clang::QualType can

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

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

    Parameters

    const clang::Type* T

    clang::TagDecl* getDecl() const

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

    bool isBeingDefined() const

    Description

    Determines whether this type is in the process of being defined.

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