unaryOperator

Coverity Documentation

Version
latest

Matches unary operators: those operators that have only one operand.

This pattern only matches nodes of type expression.

Properties

unaryOperator produces a record that contains the following properties:

Name Type Description
operandExpression expression The expression being operated upon
operator enum One of `**`, `-`, `+`, or `~` (tilde)

Inherits properties from:

Example

The following CodeXM pattern matches any use of the unary plus operator:

CXM code follows
    pattern unaryPlus {
        unaryOperator {
            .operator == `+`
        }
    };

See also

binaryOperator