https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118074

YanzuoLiu <zwuis at outlook dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |zwuis at outlook dot com

--- Comment #6 from YanzuoLiu <zwuis at outlook dot com> ---
I believe this has undefined behaviour.

When the result object is initialized from `promise.get_return_object()` is
unclear currently (See [cwg2563](https://wg21.link/cwg2563)).

- If it is initialized before calling `promise.return_value()`, `promise.a` is
uninitialized.

- If it is initialized after destroying `promise`,
`promise.get_return_object().p` becomes a dangling pointer.

Reply via email to