Skip to content

Commit 17cef3a

Browse files
burblebeetkoeppe
authored andcommitted
CWG2791 Unclear phrasing about "returning to the caller"
1 parent 520aa07 commit 17cef3a

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

source/declarations.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6763,7 +6763,7 @@
67636763
the \tcode{::operator new(size_t, nothrow_t)} form is used.
67646764
The allocation function used in this case shall have a non-throwing
67656765
\grammarterm{noexcept-specifier}.
6766-
If the allocation function returns \keyword{nullptr}, the coroutine returns
6766+
If the allocation function returns \keyword{nullptr}, the coroutine transfers
67676767
control to the caller of the coroutine and the return value is obtained by a
67686768
call to \tcode{T::get_return_object_on_allocation_failure()}, where \tcode{T}
67696769
is the promise type.

source/expressions.tex

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4747,6 +4747,8 @@
47474747
The \keyword{co_await} expression is used to suspend evaluation of a
47484748
coroutine\iref{dcl.fct.def.coroutine} while awaiting completion of
47494749
the computation represented by the operand expression.
4750+
Suspending the evaluation of a coroutine
4751+
transfers control to its caller or resumer.
47504752

47514753
\begin{bnf}
47524754
\nontermdef{await-expression}\br

source/statements.tex

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -846,7 +846,7 @@
846846
\indextext{function return|see{\tcode{return}}}%
847847

848848
\pnum
849-
A function returns to its caller by the \tcode{return} statement.
849+
A function returns control to its caller by the \tcode{return} statement.
850850

851851
\pnum
852852
The \grammarterm{expr-or-braced-init-list}
@@ -915,8 +915,8 @@
915915
\end{bnf}
916916

917917
\pnum
918-
A coroutine returns to its caller or resumer\iref{dcl.fct.def.coroutine}
919-
by the \keyword{co_return} statement or when suspended\iref{expr.await}.
918+
A \keyword{co_return} statement transfers control to
919+
the caller or resumer of a coroutine\iref{dcl.fct.def.coroutine}.
920920
A coroutine shall not enclose
921921
a \tcode{return} statement\iref{stmt.return}.
922922
\begin{note}

0 commit comments

Comments
 (0)