conditionalOperator

Coverity Documentation

Version
latest

Matches the conditional operator (sometimes called the "ternary" operator), ?:.

This pattern only matches nodes of type expression.

Properties

conditionalOperator produces a record that contains the following properties:

Name Type Description
conditionExpression expression The expression that is the condition of the operator (first argument)
falseExpression expression The expression on the false side of the operator (third argument)
trueExpression expression The expression on the true side of the operator (second argument)

Inherits properties from:

Example

The following CodeXM pattern matches all conditional operators that use the ?: operator:


CXM code follows
    pattern binaryOperatorCondition {
        conditionalOperator {
            .condtionExpression == binaryOperator
        }
    };