Both operands will be promoted to int
, and that will be the result type.
In general, integer operands are promoted to at least int
, or a larger type if necessary, and arithmetic is not performed on smaller types. This is described by C++11 4.5 (Integral promotions).
For uint8_t
:
1/ A prvalue of an integer type other than bool
, char16_t
, char32_t
, or wchar_t
whose integer conversion rank is less than the rank of int
can be converted to a prvalue of type int
if int
can represent all the values of the source type; otherwise, the source prvalue can be converted to a prvalue of type unsigned int
.
If it exists, then all 8-bit uint8_t
values are representable by int
(which must be at least 16 bits), so int
is the promoted type.
For bool
:
6/ A prvalue of type bool
can be converted to a prvalue of type int
, with false
becoming zero and true
becoming one.
So that is also promoted to int
, giving an overall result type of int
.