From Jason Turner

[stmt.label]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpmyrezets/{from.md → to.md} +25 -19
tmp/tmpmyrezets/{from.md → to.md} RENAMED
@@ -1,26 +1,32 @@
1
- ## Labeled statement <a id="stmt.label">[[stmt.label]]</a>
2
 
3
- A statement can be labeled.
 
 
 
 
 
 
 
 
4
 
5
  ``` bnf
6
  labeled-statement:
7
- attribute-specifier-seqₒₚₜ identifier ':' statement
8
- attribute-specifier-seqₒₚₜ case constant-expression ':' statement
9
- attribute-specifier-seqₒₚₜ default ':' statement
10
  ```
11
 
12
- The optional *attribute-specifier-seq* appertains to the label. An
13
- *identifier label* declares the identifier. The only use of an
14
- identifier label is as the target of a `goto`. The scope of a label is
15
- the function in which it appears. Labels shall not be redeclared within
16
- a function. A label can be used in a `goto` statement before its
17
- declaration. Labels have their own name space and do not interfere with
18
- other identifiers.
19
-
20
- [*Note 1*: A label may have the same name as another declaration in the
21
- same scope or a *template-parameter* from an enclosing scope.
22
- Unqualified name lookup [[basic.lookup.unqual]] ignores
23
- labels. *end note*]
24
-
25
- Case labels and default labels shall occur only in `switch` statements.
26
 
 
1
+ ## Label <a id="stmt.label">[[stmt.label]]</a>
2
 
3
+ A label can be added to a statement or used anywhere in a
4
+ *compound-statement*.
5
+
6
+ ``` bnf
7
+ label:
8
+ attribute-specifier-seqₒₚₜ identifier ':'
9
+ attribute-specifier-seqₒₚₜ case constant-expression ':'
10
+ attribute-specifier-seqₒₚₜ default ':'
11
+ ```
12
 
13
  ``` bnf
14
  labeled-statement:
15
+ label statement
 
 
16
  ```
17
 
18
+ The optional *attribute-specifier-seq* appertains to the label. The only
19
+ use of a label with an *identifier* is as the target of a `goto`. No two
20
+ labels in a function shall have the same *identifier*. A label can be
21
+ used in a `goto` statement before its introduction.
22
+
23
+ A *labeled-statement* whose *label* is a `case` or `default` label shall
24
+ be enclosed by [[stmt.pre]] a `switch` statement [[stmt.switch]].
25
+
26
+ A *control-flow-limited statement* is a statement `S` for which:
27
+
28
+ - a `case` or `default` label appearing within `S` shall be associated
29
+ with a `switch` statement [[stmt.switch]] within `S`, and
30
+ - a label declared in `S` shall only be referred to by a statement
31
+ [[stmt.goto]] in `S`.
32