Files
cppdraft_translate/cppdraft/stmt/expr.md
2025-10-25 03:02:53 +03:00

34 lines
1.2 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[stmt.expr]
# 8 Statements [[stmt]](./#stmt)
## 8.3 Expression statement [stmt.expr]
[1](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/statements.tex#L217)
Expression statements have the form
[expression-statement:](#nt:expression-statement "8.3Expression statement[stmt.expr]")
[*expression*](expr.comma#nt:expression "7.6.20Comma operator[expr.comma]")opt ;
The expression is
a [discarded-value expression](expr.context#def:discarded-value_expression "7.2.3Context dependence[expr.context]")[.](#1.sentence-2)
Allside effects from an expression statement
are completed before the next statement is executed[.](#1.sentence-3)
An expression statement with the [*expression*](expr.comma#nt:expression "7.6.20Comma operator[expr.comma]") missing is called
a [*null statement*](#def:statement,null "8.3Expression statement[stmt.expr]")[.](#1.sentence-4)
[*Note [1](#note-1)*:
Most statements are expression statements — usually assignments or
function calls[.](#1.sentence-5)
A null statement is useful to supply a null body to an
iteration statement such as a while statement ([[stmt.while]](stmt.while "8.6.2The while statement"))[.](#1.sentence-6)
— *end note*]