From Jason Turner

[stmt.switch]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpv2aj1bof/{from.md → to.md} +11 -9
tmp/tmpv2aj1bof/{from.md → to.md} RENAMED
@@ -1,17 +1,19 @@
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 [[conv]] to an integral or enumeration type. If the (possibly
9
- converted) type is subject to integral promotions [[conv.prom]], the
10
- condition is converted to the promoted type. Any statement within the
11
- `switch` statement can be labeled with one or more case labels as
12
- follows:
 
 
13
 
14
  ``` bnf
15
  case constant-expression ':'
16
  ```
17
 
@@ -62,8 +64,8 @@ is equivalent to
62
  init-statement
63
  switch '(' condition ')' statement
64
  '}'
65
  ```
66
 
67
- except that names declared in the *init-statement* are in the same
68
- declarative region as those declared in the *condition*.
69
 
 
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 value of a *condition* that is an initialized declaration is the
7
+ value of the declared variable, or the value of the *expression*
8
+ otherwise. The value of the condition shall be of integral type,
9
+ enumeration type, or class type. If of class type, the condition is
10
+ contextually implicitly converted [[conv]] to an integral or enumeration
11
+ type. If the (possibly converted) type is subject to integral promotions
12
+ [[conv.prom]], the condition is converted to the promoted type. Any
13
+ statement within the `switch` statement can be labeled with one or more
14
+ case labels as follows:
15
 
16
  ``` bnf
17
  case constant-expression ':'
18
  ```
19
 
 
64
  init-statement
65
  switch '(' condition ')' statement
66
  '}'
67
  ```
68
 
69
+ except that the *init-statement* is in the same scope as the
70
+ *condition*.
71