[gram.stmt]

# Annex A (informative) Grammar summary [[gram]](./#gram)

## A.6 Statements [gram.stmt]

[statement:](stmt.pre#nt:statement "8.1 Preamble [stmt.pre]")  
[*labeled-statement*](stmt.label#nt:labeled-statement "8.2 Label [stmt.label]")  
[*attribute-specifier-seq*](dcl.attr.grammar#nt:attribute-specifier-seq "9.13.1 Attribute syntax and semantics [dcl.attr.grammar]")opt [*expression-statement*](stmt.expr#nt:expression-statement "8.3 Expression statement [stmt.expr]")  
[*attribute-specifier-seq*](dcl.attr.grammar#nt:attribute-specifier-seq "9.13.1 Attribute syntax and semantics [dcl.attr.grammar]")opt [*compound-statement*](stmt.block#nt:compound-statement "8.4 Compound statement or block [stmt.block]")  
[*attribute-specifier-seq*](dcl.attr.grammar#nt:attribute-specifier-seq "9.13.1 Attribute syntax and semantics [dcl.attr.grammar]")opt [*selection-statement*](stmt.select.general#nt:selection-statement "8.5.1 General [stmt.select.general]")  
[*attribute-specifier-seq*](dcl.attr.grammar#nt:attribute-specifier-seq "9.13.1 Attribute syntax and semantics [dcl.attr.grammar]")opt [*iteration-statement*](stmt.iter.general#nt:iteration-statement "8.6.1 General [stmt.iter.general]")  
[*attribute-specifier-seq*](dcl.attr.grammar#nt:attribute-specifier-seq "9.13.1 Attribute syntax and semantics [dcl.attr.grammar]")opt [*expansion-statement*](stmt.expand#nt:expansion-statement "8.7 Expansion statements [stmt.expand]")  
[*attribute-specifier-seq*](dcl.attr.grammar#nt:attribute-specifier-seq "9.13.1 Attribute syntax and semantics [dcl.attr.grammar]")opt [*jump-statement*](stmt.jump.general#nt:jump-statement "8.8.1 General [stmt.jump.general]")  
[*attribute-specifier-seq*](dcl.attr.grammar#nt:attribute-specifier-seq "9.13.1 Attribute syntax and semantics [dcl.attr.grammar]")opt [*assertion-statement*](stmt.contract.assert#nt:assertion-statement "8.9 Assertion statement [stmt.contract.assert]")  
[*declaration-statement*](stmt.dcl#nt:declaration-statement "8.10 Declaration statement [stmt.dcl]")  
[*attribute-specifier-seq*](dcl.attr.grammar#nt:attribute-specifier-seq "9.13.1 Attribute syntax and semantics [dcl.attr.grammar]")opt [*try-block*](except.pre#nt:try-block "14.1 Preamble [except.pre]")

[init-statement:](stmt.pre#nt:init-statement "8.1 Preamble [stmt.pre]")  
[*expression-statement*](stmt.expr#nt:expression-statement "8.3 Expression statement [stmt.expr]")  
[*simple-declaration*](dcl.pre#nt:simple-declaration "9.1 Preamble [dcl.pre]")  
[*alias-declaration*](dcl.pre#nt:alias-declaration "9.1 Preamble [dcl.pre]")

[condition:](stmt.pre#nt:condition "8.1 Preamble [stmt.pre]")  
[*expression*](expr.comma#nt:expression "7.6.20 Comma operator [expr.comma]")  
[*attribute-specifier-seq*](dcl.attr.grammar#nt:attribute-specifier-seq "9.13.1 Attribute syntax and semantics [dcl.attr.grammar]")opt [*decl-specifier-seq*](dcl.spec.general#nt:decl-specifier-seq "9.2.1 General [dcl.spec.general]") [*declarator*](dcl.decl.general#nt:declarator "9.3.1 General [dcl.decl.general]") [*brace-or-equal-initializer*](dcl.init.general#nt:brace-or-equal-initializer "9.5.1 General [dcl.init.general]")  
[*structured-binding-declaration*](dcl.pre#nt:structured-binding-declaration "9.1 Preamble [dcl.pre]") [*initializer*](dcl.init.general#nt:initializer "9.5.1 General [dcl.init.general]")

[for-range-declaration:](stmt.pre#nt:for-range-declaration "8.1 Preamble [stmt.pre]")  
[*attribute-specifier-seq*](dcl.attr.grammar#nt:attribute-specifier-seq "9.13.1 Attribute syntax and semantics [dcl.attr.grammar]")opt [*decl-specifier-seq*](dcl.spec.general#nt:decl-specifier-seq "9.2.1 General [dcl.spec.general]") [*declarator*](dcl.decl.general#nt:declarator "9.3.1 General [dcl.decl.general]")  
[*structured-binding-declaration*](dcl.pre#nt:structured-binding-declaration "9.1 Preamble [dcl.pre]")

[for-range-initializer:](stmt.pre#nt:for-range-initializer "8.1 Preamble [stmt.pre]")  
[*expr-or-braced-init-list*](dcl.init.general#nt:expr-or-braced-init-list "9.5.1 General [dcl.init.general]")

[label:](stmt.label#nt:label "8.2 Label [stmt.label]")  
[*attribute-specifier-seq*](dcl.attr.grammar#nt:attribute-specifier-seq "9.13.1 Attribute syntax and semantics [dcl.attr.grammar]")opt [*identifier*](lex.name#nt:identifier "5.11 Identifiers [lex.name]") :  
[*attribute-specifier-seq*](dcl.attr.grammar#nt:attribute-specifier-seq "9.13.1 Attribute syntax and semantics [dcl.attr.grammar]")opt case [*constant-expression*](expr.const#nt:constant-expression "7.7 Constant expressions [expr.const]") :  
[*attribute-specifier-seq*](dcl.attr.grammar#nt:attribute-specifier-seq "9.13.1 Attribute syntax and semantics [dcl.attr.grammar]")opt default :

[labeled-statement:](stmt.label#nt:labeled-statement "8.2 Label [stmt.label]")  
[*label*](stmt.label#nt:label "8.2 Label [stmt.label]") [*statement*](stmt.pre#nt:statement "8.1 Preamble [stmt.pre]")

[expression-statement:](stmt.expr#nt:expression-statement "8.3 Expression statement [stmt.expr]")  
[*expression*](expr.comma#nt:expression "7.6.20 Comma operator [expr.comma]")opt ;

[compound-statement:](stmt.block#nt:compound-statement "8.4 Compound statement or block [stmt.block]")  
{ [*statement-seq*](stmt.block#nt:statement-seq "8.4 Compound statement or block [stmt.block]")opt [*label-seq*](stmt.block#nt:label-seq "8.4 Compound statement or block [stmt.block]")opt }

[statement-seq:](stmt.block#nt:statement-seq "8.4 Compound statement or block [stmt.block]")  
[*statement*](stmt.pre#nt:statement "8.1 Preamble [stmt.pre]") [*statement-seq*](stmt.block#nt:statement-seq "8.4 Compound statement or block [stmt.block]")opt

[label-seq:](stmt.block#nt:label-seq "8.4 Compound statement or block [stmt.block]")  
[*label*](stmt.label#nt:label "8.2 Label [stmt.label]") [*label-seq*](stmt.block#nt:label-seq "8.4 Compound statement or block [stmt.block]")opt

[selection-statement:](stmt.select.general#nt:selection-statement "8.5.1 General [stmt.select.general]")  
if constexpropt ( [*init-statement*](stmt.pre#nt:init-statement "8.1 Preamble [stmt.pre]")opt [*condition*](stmt.pre#nt:condition "8.1 Preamble [stmt.pre]") ) [*statement*](stmt.pre#nt:statement "8.1 Preamble [stmt.pre]")  
if constexpropt ( [*init-statement*](stmt.pre#nt:init-statement "8.1 Preamble [stmt.pre]")opt [*condition*](stmt.pre#nt:condition "8.1 Preamble [stmt.pre]") ) [*statement*](stmt.pre#nt:statement "8.1 Preamble [stmt.pre]") else [*statement*](stmt.pre#nt:statement "8.1 Preamble [stmt.pre]")  
if !opt consteval [*compound-statement*](stmt.block#nt:compound-statement "8.4 Compound statement or block [stmt.block]")  
if !opt consteval [*compound-statement*](stmt.block#nt:compound-statement "8.4 Compound statement or block [stmt.block]") else [*statement*](stmt.pre#nt:statement "8.1 Preamble [stmt.pre]")  
switch ( [*init-statement*](stmt.pre#nt:init-statement "8.1 Preamble [stmt.pre]")opt [*condition*](stmt.pre#nt:condition "8.1 Preamble [stmt.pre]") ) [*statement*](stmt.pre#nt:statement "8.1 Preamble [stmt.pre]")

[iteration-statement:](stmt.iter.general#nt:iteration-statement "8.6.1 General [stmt.iter.general]")  
while ( [*condition*](stmt.pre#nt:condition "8.1 Preamble [stmt.pre]") ) [*statement*](stmt.pre#nt:statement "8.1 Preamble [stmt.pre]")  
do [*statement*](stmt.pre#nt:statement "8.1 Preamble [stmt.pre]") while ( [*expression*](expr.comma#nt:expression "7.6.20 Comma operator [expr.comma]") ) ;  
for ( [*init-statement*](stmt.pre#nt:init-statement "8.1 Preamble [stmt.pre]") [*condition*](stmt.pre#nt:condition "8.1 Preamble [stmt.pre]")opt ; [*expression*](expr.comma#nt:expression "7.6.20 Comma operator [expr.comma]")opt ) [*statement*](stmt.pre#nt:statement "8.1 Preamble [stmt.pre]")  
for ( [*init-statement*](stmt.pre#nt:init-statement "8.1 Preamble [stmt.pre]")opt [*for-range-declaration*](stmt.pre#nt:for-range-declaration "8.1 Preamble [stmt.pre]") : [*for-range-initializer*](stmt.pre#nt:for-range-initializer "8.1 Preamble [stmt.pre]") ) [*statement*](stmt.pre#nt:statement "8.1 Preamble [stmt.pre]")

[expansion-statement:](stmt.expand#nt:expansion-statement "8.7 Expansion statements [stmt.expand]")  
template for ([*init-statement*](stmt.pre#nt:init-statement "8.1 Preamble [stmt.pre]")opt [*for-range-declaration*](stmt.pre#nt:for-range-declaration "8.1 Preamble [stmt.pre]") :[*expansion-initializer*](stmt.expand#nt:expansion-initializer "8.7 Expansion statements [stmt.expand]") ) [*compound-statement*](stmt.block#nt:compound-statement "8.4 Compound statement or block [stmt.block]")

[expansion-initializer:](stmt.expand#nt:expansion-initializer "8.7 Expansion statements [stmt.expand]")  
[*expression*](expr.comma#nt:expression "7.6.20 Comma operator [expr.comma]")  
[*expansion-init-list*](stmt.expand#nt:expansion-init-list "8.7 Expansion statements [stmt.expand]")

[expansion-init-list:](stmt.expand#nt:expansion-init-list "8.7 Expansion statements [stmt.expand]")  
{ [*expression-list*](expr.post.general#nt:expression-list "7.6.1.1 General [expr.post.general]")opt }

[jump-statement:](stmt.jump.general#nt:jump-statement "8.8.1 General [stmt.jump.general]")  
break ;  
continue ;  
return [*expr-or-braced-init-list*](dcl.init.general#nt:expr-or-braced-init-list "9.5.1 General [dcl.init.general]")opt ;  
[*coroutine-return-statement*](stmt.return.coroutine#nt:coroutine-return-statement "8.8.5 The co_­return statement [stmt.return.coroutine]")  
goto [*identifier*](lex.name#nt:identifier "5.11 Identifiers [lex.name]") ;

[coroutine-return-statement:](stmt.return.coroutine#nt:coroutine-return-statement "8.8.5 The co_­return statement [stmt.return.coroutine]")  
co_return [*expr-or-braced-init-list*](dcl.init.general#nt:expr-or-braced-init-list "9.5.1 General [dcl.init.general]")opt ;

[assertion-statement:](stmt.contract.assert#nt:assertion-statement "8.9 Assertion statement [stmt.contract.assert]")  
contract_assert [*attribute-specifier-seq*](dcl.attr.grammar#nt:attribute-specifier-seq "9.13.1 Attribute syntax and semantics [dcl.attr.grammar]")opt ( [*conditional-expression*](expr.cond#nt:conditional-expression "7.6.16 Conditional operator [expr.cond]") ) ;

[declaration-statement:](stmt.dcl#nt:declaration-statement "8.10 Declaration statement [stmt.dcl]")  
[*block-declaration*](dcl.pre#nt:block-declaration "9.1 Preamble [dcl.pre]")
