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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2025-04-28
     Ever confirmed|0                           |1

--- Comment #14 from Jason Merrill <jason at gcc dot gnu.org> ---
The new GCC behavior seems to disagree with the EWG direction on CWG2563 from
https://wiki.edg.com/bin/view/Wg21issaquah2023/NotesEWGCWG2563 "We want to
allow for the split between get_return_value and the conversion.".

Apparently EWG supported Lewis' position from
https://lists.isocpp.org/core/2023/01/13715.php

It's frustrating that apparently EWG got to see an example but it isn't
preserved anywhere.

It looks like Clang 15 introduced and then fixed this same bug
(https://github.com/llvm/llvm-project/issues/56532); the fix is described as
 "- Fix coroutines issue where ``get_return_object()`` result was always
eargerly
   converted to the return type. Eager initialization (allowing RVO) is now
only
   perfomed when these types match, otherwise deferred initialization is used,
   enabling short-circuiting coroutines use cases."

I guess it would make sense for us to take the same approach.

I'm surprised to see that I'm assigned to drafting 2563, guess I'd better get
on that.

Reply via email to