This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of Resolved status.
3469. Precondition ofcoroutine_handle::promise
may be insufficient
Section: 17.13.4.7 [coroutine.handle.promise] Status: Resolved Submitter: Jiang An Opened: 2020-07-25 Last modified: 2020-11-09
Priority: 2
View all issues with Resolved status.
Discussion:
The issue is related to LWG 3460(i).
Because thecoroutine_handle<>
base subobject of a coroutine_handle<P1>
can be assigned from the one of a coroutine_handle<P2>
, a coroutine_handle<P1>
may refer to a coroutine whose promise type is P2
. If a coroutine_handle<P>
refers to a coroutine with difference, a call to promise()
should result in undefined behavior IMO. I think that 17.13.4.7 [coroutine.handle.promise]/1 should be changed to: "Preconditions: *this
refers to a coroutine whose promise type is Promise
.", and the same precondition should be added to 17.13.5.2.5 [coroutine.handle.noop.promise], and hence noexcept
should be removed from coroutine_handle<noop_coroutine_promise>::promise
.
[2020-08-21; Reflector prioritization]
Set priority to 2 after reflector discussions.
Previous resolution [SUPERSEDED]:
This wording is relative to N4861.
Modify 17.13.4.7 [coroutine.handle.promise] as indicated:
Promise& promise() const;-1- Preconditions:
-2- Returns: A reference to the promise of the coroutine.*this
refers to a coroutine whose promise type isPromise
.Modify 17.13.5.2 [coroutine.handle.noop], class
coroutine_handle<noop_coroutine_promise>
synopsis, as indicated:[…] // 17.13.5.2.5 [coroutine.handle.noop.promise], promise access noop_coroutine_promise& promise() const noexcept; […]Modify 17.13.5.2.5 [coroutine.handle.noop.promise] as indicated:
noop_coroutine_promise& promise() const noexcept;-?- Preconditions:
-1- Returns: A reference to the promise object associated with this coroutine handle.*this
refers to a coroutine whose promise type isnoop_coroutine_promise
.
[2020-11-09 Resolved by acceptance of 3460(i). Status changed: Tentatively Resolved → Resolved.]
Proposed resolution:
This issue is resolved by the resolution of issue 3460(i).
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4