tmp/tmp_nyi86or/{from.md → to.md}
RENAMED
|
@@ -7,36 +7,40 @@ This pattern is called the *usual arithmetic conversions*, which are
|
|
| 7 |
defined as follows:
|
| 8 |
|
| 9 |
- If either operand is of scoped enumeration type [[dcl.enum]], no
|
| 10 |
conversions are performed; if the other operand does not have the same
|
| 11 |
type, the expression is ill-formed.
|
| 12 |
-
-
|
| 13 |
-
|
| 14 |
-
- Otherwise, if either operand is `double`, the other shall be converted
|
| 15 |
-
to `double`.
|
| 16 |
-
- Otherwise, if either operand is `float`, the other shall be converted
|
| 17 |
-
to `float`.
|
| 18 |
-
- Otherwise, the integral promotions [[conv.prom]] shall be performed on
|
| 19 |
-
both operands.[^9] Then the following rules shall be applied to the
|
| 20 |
-
promoted operands:
|
| 21 |
- If both operands have the same type, no further conversion is
|
| 22 |
needed.
|
| 23 |
-
- Otherwise, if
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
|
| 39 |
If one operand is of enumeration type and the other operand is of a
|
| 40 |
different enumeration type or a floating-point type, this behavior is
|
| 41 |
deprecated [[depr.arith.conv.enum]].
|
| 42 |
|
|
|
|
| 7 |
defined as follows:
|
| 8 |
|
| 9 |
- If either operand is of scoped enumeration type [[dcl.enum]], no
|
| 10 |
conversions are performed; if the other operand does not have the same
|
| 11 |
type, the expression is ill-formed.
|
| 12 |
+
- Otherwise, if either operand is of floating-point type, the following
|
| 13 |
+
rules are applied:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
- If both operands have the same type, no further conversion is
|
| 15 |
needed.
|
| 16 |
+
- Otherwise, if one of the operands is of a non-floating-point type,
|
| 17 |
+
that operand is converted to the type of the operand with the
|
| 18 |
+
floating-point type.
|
| 19 |
+
- Otherwise, if the floating-point conversion ranks [[conv.rank]] of
|
| 20 |
+
the types of the operands are ordered but not equal, then the
|
| 21 |
+
operand of the type with the lesser floating-point conversion rank
|
| 22 |
+
is converted to the type of the other operand.
|
| 23 |
+
- Otherwise, if the floating-point conversion ranks of the types of
|
| 24 |
+
the operands are equal, then the operand with the lesser
|
| 25 |
+
floating-point conversion subrank [[conv.rank]] is converted to the
|
| 26 |
+
type of the other operand.
|
| 27 |
+
- Otherwise, the expression is ill-formed.
|
| 28 |
+
- Otherwise, each operand is converted to a common type `C`. The
|
| 29 |
+
integral promotion rules [[conv.prom]] are used to determine a type
|
| 30 |
+
`T1` and type `T2` for each operand.[^9]
|
| 31 |
+
Then the following rules are applied to determine `C`:
|
| 32 |
+
- If `T1` and `T2` are the same type, `C` is that type.
|
| 33 |
+
- Otherwise, if `T1` and `T2` are both signed integer types or are
|
| 34 |
+
both unsigned integer types, `C` is the type with greater rank.
|
| 35 |
+
- Otherwise, let `U` be the unsigned integer type and `S` be the
|
| 36 |
+
signed integer type.
|
| 37 |
+
- If `U` has rank greater than or equal to the rank of `S`, `C` is
|
| 38 |
+
`U`.
|
| 39 |
+
- Otherwise, if `S` can represent all of the values of `U`, `C` is
|
| 40 |
+
`S`.
|
| 41 |
+
- Otherwise, `C` is the unsigned integer type corresponding to `S`.
|
| 42 |
|
| 43 |
If one operand is of enumeration type and the other operand is of a
|
| 44 |
different enumeration type or a floating-point type, this behavior is
|
| 45 |
deprecated [[depr.arith.conv.enum]].
|
| 46 |
|