From Jason Turner

[conv.prom]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp8tt1epzx/{from.md → to.md} +21 -23
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 ([[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 ([[dcl.enum]]) can be converted to a prvalue of the first of the
20
- following types that can represent all the values of the enumeration
21
- (i.e., the values in the range bₘin to bₘax as described in 
22
- [[dcl.enum]]): `int`, `unsigned int`, `long int`, `unsigned long int`,
23
- `long long int`, or `unsigned long long int`. If none of the types in
24
- that list can represent all the values of the enumeration, a prvalue of
25
- an unscoped enumeration type can be converted to a prvalue of the
26
- extended integer type with lowest integer conversion rank (
27
- [[conv.rank]]) greater than the rank of `long long` in which all the
28
- values of the enumeration can be represented. If there are two such
29
- extended types, the signed one is chosen.
30
 
31
- A prvalue of an unscoped enumeration type whose underlying type is
32
- fixed ([[dcl.enum]]) can be converted to a prvalue of its underlying
33
- type. Moreover, if integral promotion can be applied to its underlying
34
- type, a prvalue of an unscoped enumeration type whose underlying type is
35
- fixed can also be converted to a prvalue of the promoted underlying
36
- type.
37
 
38
- A prvalue for an integral bit-field ([[class.bit]]) can be converted to
39
- a prvalue of type `int` if `int` can represent all the values of the
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.