Module Cast

Import path

semmle.code.cpp.exprs.Cast

Imports

Classes

AlignofExprOperator

A C++11 alignof expression whose operand is an expression.

AlignofOperator

A C++11 alignof expression.

AlignofTypeOperator

A C++11 alignof expression whose operand is a type name.

ArithmeticConversion

A conversion from one arithmetic or enum type to another.

ArrayToPointerConversion

A C/C++ array to pointer conversion.

BaseClassConversion

A conversion from a pointer or glvalue of a derived class to a pointer or glvalue of a direct or virtual base class.

BoolConversion

A conversion to bool. Returns false if the source value is zero, false, or nullptr. Returns true otherwise.

CStyleCast

A cast expression in C, or a C-style cast expression in C++.

Cast

A C/C++ cast expression.

ConstCast

A C++ const_cast expression.

Conversion

A C/C++ cast expression or similar unary expression that doesn’t affect the logical value of its operand.

DerivedClassConversion

A conversion from a pointer or glvalue to a base class to a pointer or glvalue to a direct derived class.

DynamicCast

A C++ dynamic_cast expression.

FloatingPointConversion

A conversion from one floating point type to another.

FloatingPointToIntegralConversion

A conversion from a floating point type to an integral or enum type.

GlvalueConversion

A conversion of a glvalue from one type to another. The conversion does not modify the address of the glvalue. For glvalue conversions involving base and derived classes, see BaseClassConversion and DerivedClassConversion.

InheritanceConversion

A conversion between two pointers or glvalues related by inheritance. The base class will always be either a direct base class of the derived class, or a virtual base class of the derived class. A conversion to an indirect non-virtual base class will be represented as a sequence of conversions to direct base classes.

IntegralConversion

A conversion from one integral or enum type to another.

IntegralToFloatingPointConversion

A conversion from an integral or enum type to a floating point type.

IntegralToPointerConversion

A conversion from an integral or enum type to a pointer type.

PointerConversion

A conversion from one pointer type to another. The conversion does not modify the value of the pointer. For pointer conversions involving casts between base and derived classes, see BaseClassConversion and DerivedClassConversion.

PointerToIntegralConversion

A conversion from a pointer type to an integral or enum type.

PointerToMemberBaseClassConversion

A conversion from a pointer-to-member of a derived class to a pointer-to-member of an immediate base class.

PointerToMemberConversion

A conversion from one pointer-to-member type to another. The conversion does not modify the value of the pointer-to-member. For pointer-to-member conversions involving casts between base and derived classes, see PointerToMemberBaseClassConversion and PointerToMemberDerivedClassConversion.

PointerToMemberDerivedClassConversion

A conversion from a pointer-to-member of a base class to a pointer-to-member of an immediate derived class.

PrvalueAdjustmentConversion

The adjustment of the type of a class prvalue. Most commonly seen in code similar to:

ReinterpretCast

A C++ reinterpret_cast expression.

SizeofExprOperator

A C/C++ sizeof expression whose operand is an expression.

SizeofOperator

A C/C++ sizeof expression.

SizeofPackOperator

A C++11 sizeof... expression which determines the size of a template parameter pack.

SizeofTypeOperator

A C/C++ sizeof expression whose operand is a type name.

StaticCast

A C++ static_cast expression.

TypeidOperator

A C++ typeid expression which provides runtime type information about an expression or type.

UuidofOperator

A Microsoft C/C++ __uuidof expression that returns the UUID of a type, as specified by the __declspec(uuid) attribute.

VoidConversion

A conversion to void.

Modules

CastSanity

INTERNAL: Do not use. Query predicates used to check invariants that should hold for all Cast nodes. To run all sanity queries for the ASTs, including the ones below, run “semmle/code/cpp/ASTSanity.ql”.