castOperatorExplicit

Coverity Documentation

Version
latest

Matches explicit casts.

This pattern only matches nodes of type expression.

Properties

castOperatorExplicit produces a record that contains the following properties:

Name Type Description
kind enum castKind Always `explicit`; see castKind
operandExpression expression The expression being cast

Inherits properties from:

Example

The following snippet of Java casts i to short:


Java code follows
int i = 5;
short a = (short) i;

... you could use the following CodeXM pattern to match it:


CXM code follows
    pattern castToShort {
        castOperatorExplicit {
            .type == shortType
        }
    };