tmp/tmp8z6ve0ic/{from.md → to.md}
RENAMED
|
@@ -0,0 +1,83 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
## Preamble <a id="stmt.pre">[[stmt.pre]]</a>
|
| 2 |
+
|
| 3 |
+
Except as indicated, statements are executed in sequence.
|
| 4 |
+
|
| 5 |
+
``` bnf
|
| 6 |
+
statement:
|
| 7 |
+
labeled-statement
|
| 8 |
+
attribute-specifier-seqₒₚₜ expression-statement
|
| 9 |
+
attribute-specifier-seqₒₚₜ compound-statement
|
| 10 |
+
attribute-specifier-seqₒₚₜ selection-statement
|
| 11 |
+
attribute-specifier-seqₒₚₜ iteration-statement
|
| 12 |
+
attribute-specifier-seqₒₚₜ jump-statement
|
| 13 |
+
declaration-statement
|
| 14 |
+
attribute-specifier-seqₒₚₜ try-block
|
| 15 |
+
|
| 16 |
+
init-statement:
|
| 17 |
+
expression-statement
|
| 18 |
+
simple-declaration
|
| 19 |
+
|
| 20 |
+
condition:
|
| 21 |
+
expression
|
| 22 |
+
attribute-specifier-seqₒₚₜ decl-specifier-seq declarator brace-or-equal-initializer
|
| 23 |
+
```
|
| 24 |
+
|
| 25 |
+
The optional *attribute-specifier-seq* appertains to the respective
|
| 26 |
+
statement.
|
| 27 |
+
|
| 28 |
+
A *substatement* of a *statement* is one of the following:
|
| 29 |
+
|
| 30 |
+
- for a *labeled-statement*, its contained *statement*,
|
| 31 |
+
- for a *compound-statement*, any *statement* of its *statement-seq*,
|
| 32 |
+
- for a *selection-statement*, any of its *statement*s (but not its
|
| 33 |
+
*init-statement*), or
|
| 34 |
+
- for an *iteration-statement*, its contained *statement* (but not an
|
| 35 |
+
*init-statement*).
|
| 36 |
+
|
| 37 |
+
[*Note 1*: The *compound-statement* of a *lambda-expression* is not a
|
| 38 |
+
substatement of the *statement* (if any) in which the
|
| 39 |
+
*lambda-expression* lexically appears. — *end note*]
|
| 40 |
+
|
| 41 |
+
A *statement* `S1` *encloses* a *statement* `S2` if
|
| 42 |
+
|
| 43 |
+
- `S2` is a substatement of `S1` [[dcl.dcl]],
|
| 44 |
+
- `S1` is a *selection-statement* or *iteration-statement* and `S2` is
|
| 45 |
+
the *init-statement* of `S1`,
|
| 46 |
+
- `S1` is a *try-block* and `S2` is its *compound-statement* or any of
|
| 47 |
+
the *compound-statement*s of its *handler*s, or
|
| 48 |
+
- `S1` encloses a statement `S3` and `S3` encloses `S2`.
|
| 49 |
+
|
| 50 |
+
The rules for *condition*s apply both to *selection-statement*s and to
|
| 51 |
+
the `for` and `while` statements [[stmt.iter]]. A *condition* that is
|
| 52 |
+
not an *expression* is a declaration [[dcl.dcl]]. The *declarator* shall
|
| 53 |
+
not specify a function or an array. The *decl-specifier-seq* shall not
|
| 54 |
+
define a class or enumeration. If the `auto` *type-specifier* appears in
|
| 55 |
+
the *decl-specifier-seq*, the type of the identifier being declared is
|
| 56 |
+
deduced from the initializer as described in [[dcl.spec.auto]].
|
| 57 |
+
|
| 58 |
+
[*Note 2*: A name introduced in a *selection-statement* or
|
| 59 |
+
*iteration-statement* outside of any substatement is in scope from its
|
| 60 |
+
point of declaration until the end of the statement’s substatements.
|
| 61 |
+
Such a name cannot be redeclared in the outermost block of any of the
|
| 62 |
+
substatements [[basic.scope.block]]. — *end note*]
|
| 63 |
+
|
| 64 |
+
The value of a *condition* that is an initialized declaration in a
|
| 65 |
+
statement other than a `switch` statement is the value of the declared
|
| 66 |
+
variable contextually converted to `bool` [[conv]]. If that conversion
|
| 67 |
+
is ill-formed, the program is ill-formed. The value of a *condition*
|
| 68 |
+
that is an initialized declaration in a `switch` statement is the value
|
| 69 |
+
of the declared variable if it has integral or enumeration type, or of
|
| 70 |
+
that variable implicitly converted to integral or enumeration type
|
| 71 |
+
otherwise. The value of a *condition* that is an expression is the value
|
| 72 |
+
of the expression, contextually converted to `bool` for statements other
|
| 73 |
+
than `switch`; if that conversion is ill-formed, the program is
|
| 74 |
+
ill-formed. The value of the condition will be referred to as simply
|
| 75 |
+
“the condition” where the usage is unambiguous.
|
| 76 |
+
|
| 77 |
+
If a *condition* can be syntactically resolved as either an expression
|
| 78 |
+
or the declaration of a block-scope name, it is interpreted as a
|
| 79 |
+
declaration.
|
| 80 |
+
|
| 81 |
+
In the *decl-specifier-seq* of a *condition*, each *decl-specifier*
|
| 82 |
+
shall be either a *type-specifier* or `constexpr`.
|
| 83 |
+
|