From Jason Turner

[stmt.switch]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpfby2822y/{from.md → to.md} +9 -11
tmp/tmpfby2822y/{from.md → to.md} RENAMED
@@ -1,28 +1,26 @@
1
  ### The `switch` statement <a id="stmt.switch">[[stmt.switch]]</a>
2
 
3
  The `switch` statement causes control to be transferred to one of
4
  several statements depending on the value of a condition.
5
 
6
- The condition shall be of integral type, enumeration type, or of a class
7
- type for which a single non-explicit conversion function to integral or
8
- enumeration type exists ([[class.conv]]). If the condition is of class
9
- type, the condition is converted by calling that conversion function,
10
- and the result of the conversion is used in place of the original
11
- condition for the remainder of this section. Integral promotions are
12
- performed. Any statement within the `switch` statement can be labeled
13
- with one or more case labels as follows:
14
 
15
  ``` bnf
16
  'case' constant-expression ':'
17
  ```
18
 
19
  where the *constant-expression* shall be a converted constant
20
- expression ([[expr.const]]) of the promoted type of the switch
21
  condition. No two of the case constants in the same switch shall have
22
- the same value after conversion to the promoted type of the switch
23
- condition.
24
 
25
  There shall be at most one label of the form
26
 
27
  ``` cpp
28
  default :
 
1
  ### The `switch` statement <a id="stmt.switch">[[stmt.switch]]</a>
2
 
3
  The `switch` statement causes control to be transferred to one of
4
  several statements depending on the value of a condition.
5
 
6
+ The condition shall be of integral type, enumeration type, or class
7
+ type. If of class type, the condition is contextually implicitly
8
+ converted (Clause  [[conv]]) to an integral or enumeration type. If the
9
+ (possibly converted) type is subject to integral promotions (
10
+ [[conv.prom]]), the condition is converted to the promoted type. Any
11
+ statement within the `switch` statement can be labeled with one or more
12
+ case labels as follows:
 
13
 
14
  ``` bnf
15
  'case' constant-expression ':'
16
  ```
17
 
18
  where the *constant-expression* shall be a converted constant
19
+ expression ([[expr.const]]) of the adjusted type of the switch
20
  condition. No two of the case constants in the same switch shall have
21
+ the same value after conversion.
 
22
 
23
  There shall be at most one label of the form
24
 
25
  ``` cpp
26
  default :