8
Statements
[stmt.stmt]
8.2
Label
[stmt.label]
1
#
A label can be added to a statement or used anywhere in a
compound-statement
.
label
:
attribute-specifier-seq
o
p
t
identifier
:
attribute-specifier-seq
o
p
t
case
constant-expression
:
attribute-specifier-seq
o
p
t
default
:
labeled-statement
:
label
statement
The optional
attribute-specifier-seq
appertains to the label
.
The only use of a label with an
identifier
is as the target of a
goto
.
No two labels in a function shall have the same
identifier
.
A label can be used in a
goto
statement before its introduction
.
2
#
A
labeled-statement
whose
label
is a
case
or
default
label shall be enclosed by (
[stmt.
pre]
) a
switch
statement (
[stmt.
switch]
)
.
3
#
A
control-flow-limited statement
is a statement
S
for which:
(3.1)
a
case
or
default
label appearing within
S
shall be associated with a
switch
statement (
[stmt.
switch]
) within
S
, and
(3.2)
a label declared in
S
shall only be referred to by a statement (
[stmt.
goto]
) in
S
.