This commit is contained in:
2025-10-25 03:02:53 +03:00
commit 043225d523
3416 changed files with 681196 additions and 0 deletions

35
cppdraft/stmt/block.md Normal file
View File

@@ -0,0 +1,35 @@
[stmt.block]
# 8 Statements [[stmt]](./#stmt)
## 8.4 Compound statement or block [stmt.block]
[1](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/statements.tex#L243)
A [*compound statement*](#def:statement,compound "8.4Compound statement or block[stmt.block]") (also known as a block) groups a
sequence of statements into a single statement[.](#1.sentence-1)
[compound-statement:](#nt:compound-statement "8.4Compound statement or block[stmt.block]")
{ [*statement-seq*](#nt:statement-seq "8.4Compound statement or block[stmt.block]")opt [*label-seq*](#nt:label-seq "8.4Compound statement or block[stmt.block]")opt }
[statement-seq:](#nt:statement-seq "8.4Compound statement or block[stmt.block]")
[*statement*](stmt.pre#nt:statement "8.1Preamble[stmt.pre]") [*statement-seq*](#nt:statement-seq "8.4Compound statement or block[stmt.block]")opt
[label-seq:](#nt:label-seq "8.4Compound statement or block[stmt.block]")
[*label*](stmt.label#nt:label "8.2Label[stmt.label]") [*label-seq*](#nt:label-seq "8.4Compound statement or block[stmt.block]")opt
A label at the end of a [*compound-statement*](#nt:compound-statement "8.4Compound statement or block[stmt.block]") is treated as if it were followed by a null statement[.](#1.sentence-2)
[2](#2)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/statements.tex#L265)
[*Note [1](#note-1)*:
A compound statement defines a block scope ([[basic.scope]](basic.scope "6.4Scope"))[.](#2.sentence-1)
A declaration is a [*statement*](stmt.pre#nt:statement "8.1Preamble[stmt.pre]") ([[stmt.dcl]](stmt.dcl "8.10Declaration statement"))[.](#2.sentence-2)
— *end note*]