§5.10 (Equality operators) Abs. 1
The == (equal to) and the != (not equal to) operators have the same semantic restrictions, conversions, and
result type as the relational operators except for their lower precedence and truth-value result.
§5.9 (Relational operators) Abs. 2
The usual arithmetic conversions are performed on operands of arithmetic or enumeration type.
§5 (Expressions) Abs. 10
Many binary operators that expect operands of arithmetic or enumeration type cause conversions and yield
result types in a similar way. The purpose is to yield a common type, which is also the type of the result.
This pattern is called the usual arithmetic conversions, which are defined as follows:
[...]
Otherwise, the integral promotions (4.5) shall be performed on both operands. Then the following rules shall be applied to the promoted operands:
- If both operands have the same type, no further conversion is needed.
[...]
§3.9.1 (Fundamental types) Abs. 6
Values of type bool are either true or false. [ Note: There are no signed, unsigned, short, or long
bool types or values. — end note ] Values of type bool participate in integral promotions.
§4.5 (Integral promotions) Abs. 6
A prvalue of type bool can be converted to a prvalue of type int, with false becoming zero and true
becoming one.