Skip to content

Commit 4143715

Browse files
jensmaurertkoeppe
authored andcommitted
CWG2345 [stmt.stmt, stmt.dcl] Jumping across initializers in init-statements and conditions (#1949)
1 parent 42e35cf commit 4143715

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

source/statements.tex

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,10 @@
3535
\indextext{\idxgram{condition}{s}!rules for}%
3636
The rules for \grammarterm{condition}{s} apply both to
3737
\grammarterm{selection-statement}{s} and to the \tcode{for} and \tcode{while}
38-
statements\iref{stmt.iter}. The \grammarterm{declarator} shall not
38+
statements\iref{stmt.iter}.
39+
A \grammarterm{condition} that is not an \grammarterm{expression} is a
40+
declaration\iref{dcl.dcl}.
41+
The \grammarterm{declarator} shall not
3942
specify a function or an array. The \grammarterm{decl-specifier-seq} shall not
4043
define a class or enumeration. If the \tcode{auto} \grammarterm{type-specifier} appears in
4144
the \grammarterm{decl-specifier-seq},
@@ -898,7 +901,9 @@
898901
\indextext{initialization!jump past}%
899902
\indextext{\idxcode{goto}!initialization and}%
900903
It is possible to transfer into a block, but not in a way that bypasses
901-
declarations with initialization. A program that jumps\footnote{The transfer from the condition of a \tcode{switch} statement to a
904+
declarations with initialization (including ones in \grammarterm{condition}s
905+
and \grammarterm{init-statement}s).
906+
A program that jumps\footnote{The transfer from the condition of a \tcode{switch} statement to a
902907
\tcode{case} label is considered a jump in this respect.}
903908
from a point where a variable with automatic storage duration is
904909
not in scope to a point where it is in scope is ill-formed unless the

0 commit comments

Comments
 (0)