tmp/tmp8tt1epzx/{from.md → to.md}
RENAMED
|
@@ -1,44 +1,42 @@
|
|
| 1 |
-
## Integral promotions <a id="conv.prom">[[conv.prom]]</a>
|
| 2 |
|
| 3 |
A prvalue of an integer type other than `bool`, `char16_t`, `char32_t`,
|
| 4 |
-
or `wchar_t` whose integer conversion rank
|
| 5 |
the rank of `int` can be converted to a prvalue of type `int` if `int`
|
| 6 |
can represent all the values of the source type; otherwise, the source
|
| 7 |
prvalue can be converted to a prvalue of type `unsigned int`.
|
| 8 |
|
| 9 |
-
A prvalue of type `char16_t`, `char32_t`, or `wchar_t`
|
| 10 |
-
[[basic.fundamental]]
|
| 11 |
following types that can represent all the values of its underlying
|
| 12 |
type: `int`, `unsigned int`, `long int`, `unsigned long int`,
|
| 13 |
`long long int`, or `unsigned long long int`. If none of the types in
|
| 14 |
that list can represent all the values of its underlying type, a prvalue
|
| 15 |
of type `char16_t`, `char32_t`, or `wchar_t` can be converted to a
|
| 16 |
prvalue of its underlying type.
|
| 17 |
|
| 18 |
A prvalue of an unscoped enumeration type whose underlying type is not
|
| 19 |
-
fixed
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
extended types, the signed one is chosen.
|
| 30 |
|
| 31 |
-
A prvalue of an unscoped enumeration type whose underlying type is
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
type.
|
| 37 |
|
| 38 |
-
A prvalue for an integral bit-field
|
| 39 |
-
|
| 40 |
bit-field; otherwise, it can be converted to `unsigned int` if
|
| 41 |
`unsigned int` can represent all the values of the bit-field. If the
|
| 42 |
bit-field is larger yet, no integral promotion applies to it. If the
|
| 43 |
bit-field has an enumerated type, it is treated as any other value of
|
| 44 |
that type for promotion purposes.
|
|
|
|
| 1 |
+
### Integral promotions <a id="conv.prom">[[conv.prom]]</a>
|
| 2 |
|
| 3 |
A prvalue of an integer type other than `bool`, `char16_t`, `char32_t`,
|
| 4 |
+
or `wchar_t` whose integer conversion rank [[conv.rank]] is less than
|
| 5 |
the rank of `int` can be converted to a prvalue of type `int` if `int`
|
| 6 |
can represent all the values of the source type; otherwise, the source
|
| 7 |
prvalue can be converted to a prvalue of type `unsigned int`.
|
| 8 |
|
| 9 |
+
A prvalue of type `char16_t`, `char32_t`, or `wchar_t`
|
| 10 |
+
[[basic.fundamental]] can be converted to a prvalue of the first of the
|
| 11 |
following types that can represent all the values of its underlying
|
| 12 |
type: `int`, `unsigned int`, `long int`, `unsigned long int`,
|
| 13 |
`long long int`, or `unsigned long long int`. If none of the types in
|
| 14 |
that list can represent all the values of its underlying type, a prvalue
|
| 15 |
of type `char16_t`, `char32_t`, or `wchar_t` can be converted to a
|
| 16 |
prvalue of its underlying type.
|
| 17 |
|
| 18 |
A prvalue of an unscoped enumeration type whose underlying type is not
|
| 19 |
+
fixed can be converted to a prvalue of the first of the following types
|
| 20 |
+
that can represent all the values of the enumeration [[dcl.enum]]:
|
| 21 |
+
`int`, `unsigned int`, `long int`, `unsigned long int`, `long long int`,
|
| 22 |
+
or `unsigned long long int`. If none of the types in that list can
|
| 23 |
+
represent all the values of the enumeration, a prvalue of an unscoped
|
| 24 |
+
enumeration type can be converted to a prvalue of the extended integer
|
| 25 |
+
type with lowest integer conversion rank [[conv.rank]] greater than the
|
| 26 |
+
rank of `long long` in which all the values of the enumeration can be
|
| 27 |
+
represented. If there are two such extended types, the signed one is
|
| 28 |
+
chosen.
|
|
|
|
| 29 |
|
| 30 |
+
A prvalue of an unscoped enumeration type whose underlying type is fixed
|
| 31 |
+
[[dcl.enum]] can be converted to a prvalue of its underlying type.
|
| 32 |
+
Moreover, if integral promotion can be applied to its underlying type, a
|
| 33 |
+
prvalue of an unscoped enumeration type whose underlying type is fixed
|
| 34 |
+
can also be converted to a prvalue of the promoted underlying type.
|
|
|
|
| 35 |
|
| 36 |
+
A prvalue for an integral bit-field [[class.bit]] can be converted to a
|
| 37 |
+
prvalue of type `int` if `int` can represent all the values of the
|
| 38 |
bit-field; otherwise, it can be converted to `unsigned int` if
|
| 39 |
`unsigned int` can represent all the values of the bit-field. If the
|
| 40 |
bit-field is larger yet, no integral promotion applies to it. If the
|
| 41 |
bit-field has an enumerated type, it is treated as any other value of
|
| 42 |
that type for promotion purposes.
|