Class Type
A C/C++ type.
This QL class represents the root of the C/C++ type hierarchy.
Import path
import cpp
Indirect supertypes
Known direct subtypes
Predicates
explain | Gets a detailed string representation explaining the AST of this type (with all specifiers and nested constructs such as pointers). This is intended to help debug queries and is a very expensive operation; not to be used in production queries. |
getASpecifier | Gets a specifier of this type, recursively looking through |
getATypeNameUse | Gets as many places as possible where this type is used by name in the source after macros have been replaced (in particular, therefore, this will find type name uses caused by macros). Note that all type name uses within instantiations are currently excluded - this is too draconian in the absence of indexing prototype instantiations of functions, and is likely to improve in the future. At present, the method takes the conservative approach of giving valid type name uses, but not necessarily all type name uses. |
getAlignment | Gets the alignment of this type in bytes. |
getAnAttribute | Gets an attribute of this type. |
getLocation | Gets the primary location of this element. |
getName | Gets the name of this type. |
getPointerIndirectionLevel | Gets the pointer indirection level of this type. |
getSize | Gets the size of this type in bytes. |
getUnderlyingType | Gets this type after typedefs have been resolved. |
getUnspecifiedType | Gets this type after specifiers have been deeply stripped and typedefs have been resolved. |
hasName | Holds if this type is called |
hasSpecifier | Holds if this declaration has a specifier called |
internal_getAnAdditionalSpecifier | Internal – should be |
involvesReference | Holds if this type involves a reference. |
involvesTemplateParameter | Holds if this type involves a template parameter. |
isConst | Holds if this type is const. |
isDeeplyConst | Holds if this type is constant and only contains constant types. For instance, a |
isDeeplyConstBelow | Holds if this type is constant and only contains constant types, excluding the type itself. It is implied by Type.isDeeplyConst() and is just used to implement that predicate. For example, |
isVolatile | Holds if this type is volatile. |
refersTo | Holds if this type refers to type |
refersToDirectly | Holds if this type refers to type |
resolveTypedefs | Gets this type with any typedefs resolved. For example, given |
stripTopLevelSpecifiers | Gets this type after any top-level specifiers and typedefs have been stripped. |
stripType | Gets the type stripped of pointers, references and cv-qualifiers, and resolving typedefs. For example, given |
Inherited predicates
findRootCause | Gets the source of this element: either itself or a macro that expanded to this element. | from Element |
fromSource | Holds if this element may be from source. This predicate holds for all elements, except for those in the dummy file, whose name is the empty string. The dummy file contains declarations that are built directly into the compiler. | from Element |
getAPrimaryQlClass | Gets the name of a primary CodeQL class to which this element belongs. | from ElementBase |
getEnclosingElement | Gets the closest | from Element |
getFile | Gets the primary file where this element occurs. | from Element |
getParentScope | Gets the parent scope of this | from Element |
getPrimaryQlClasses | Gets a comma-separated list of the names of the primary CodeQL classes to which this element belongs. | from ElementBase |
isAffectedByMacro | Holds if this element is affected in any way by a macro. All elements that are totally or partially generated by a macro are included, so this is a super-set of | from Element |
isFromTemplateInstantiation | Holds if this | from Element |
isFromUninstantiatedTemplate | Holds if this | from Element |
isInMacroExpansion | Holds if this element comes from a macro expansion. Only elements that are entirely generated by a macro are included - for elements that partially come from a macro, see | from Element |
toString | Gets a textual representation of this element. | from ElementBase |