8 Statements [stmt.stmt]

8.5 Selection statements [stmt.select]

8.5.1 General [stmt.select.general]

Selection statements choose one of several flows of control.
See [dcl.meaning] for the optional attribute-specifier-seq in a condition.
[Note 1:
An init-statement ends with a semicolon.
— end note]
The substatement in a selection-statement (each substatement, in the else form of the if statement) implicitly defines a block scope ([basic.scope]).
If the substatement in a selection-statement is a single statement and not a compound-statement, it is as if it was rewritten to be a compound-statement containing the original substatement.
[Example 1:
if (x) int i; can be equivalently rewritten as if (x) { int i; }
Thus after the if statement, i is no longer in scope.
— end example]