8 Statements [stmt.stmt]

8.1 Preamble [stmt.pre]

Except as indicated, statements are executed in sequence.
The optional attribute-specifier-seq appertains to the respective statement.
A substatement of a statement is one of the following:
[Note 1:
The compound-statement of a lambda-expression is not a substatement of the statement (if any) in which the lambda-expression lexically appears.
— end note]
A statement S1 encloses a statement S2 if
The rules for conditions apply both to selection-statements and to the for and while statements ([stmt.iter]).
A condition that is not an expression is a declaration ([dcl.dcl]).
The declarator shall not specify a function or an array.
The decl-specifier-seq shall not define a class or enumeration.
If the auto type-specifier appears in the decl-specifier-seq, the type of the identifier being declared is deduced from the initializer as described in [dcl.spec.auto].
The value of a condition that is an initialized declaration in a statement other than a switch statement is the value of the declared variable contextually converted to bool.
If that conversion is ill-formed, the program is ill-formed.
The value of a condition that is an initialized declaration in a switch statement is the value of the declared variable if it has integral or enumeration type, or of that variable implicitly converted to integral or enumeration type otherwise.
The value of a condition that is an expression is the value of the expression, contextually converted to bool for statements other than switch; if that conversion is ill-formed, the program is ill-formed.
The value of the condition will be referred to as simply “the condition” where the usage is unambiguous.
If a condition can be syntactically resolved as either an expression or a declaration, it is interpreted as the latter.
In the decl-specifier-seq of a condition, each decl-specifier shall be either a type-specifier or constexpr.