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

--- Comment #2 from Riccardo Brugo <riki--b at hotmail dot it> ---
(In reply to Iain Sandoe from comment #1)
> I think that this issue is already fixed in the released 10.3 branch and in
> master (will shortly become GCC11).  Please could you try one of those?
> 
> $ ./gcc-10/gcc-10/bin/g++ -std=c++20 -fcoroutines pr100127.C -S -save-temps
> pr100127.C: In function ‘future create_future()’:
> pr100127.C:54:8: error: the coroutine promise type
> ‘std::__n4861::__coroutine_traits_impl<future, void>::promise_type’ {aka
> ‘future::promise_type’} declares both ‘return_value’ and ‘return_void’
>    54 | future create_future()
>       |        ^~~~~~~~~~~~~
> pr100127.C:49:14: note: ‘return_void’ declared here
>    49 |         void return_void() {}
>       |              ^~~~~~~~~~~
> pr100127.C:31:14: note: ‘return_value’ declared here
>    31 |         void return_value(value_type val) {
>       |              ^~~~~~~~~~~~
> 
> === 
> 
> $ ./gcc-master/gcc-11-0-1/bin/g++ -std=c++20 -fcoroutines pr100127.C -S
> -save-temps
> pr100127.C: In function ‘future create_future()’:
> pr100127.C:54:8: error: the coroutine promise type
> ‘std::__n4861::__coroutine_traits_impl<future, void>::promise_type’ {aka
> ‘future::promise_type’} declares both ‘return_value’ and ‘return_void’
>    54 | future create_future()
>       |        ^~~~~~~~~~~~~
> pr100127.C:49:14: note: ‘return_void’ declared here
>    49 |         void return_void() {}
>       |              ^~~~~~~~~~~
> pr100127.C:31:14: note: ‘return_value’ declared here
>    31 |         void return_value(value_type val) {
>       |              ^~~~~~~~~~~~

Removing the `return_void` member function will trigger a compilation error in
trunk (https://godbolt.org/z/7vfT89KEx) and a segmentation fault in 10.3
(https://godbolt.org/z/7b37sPbfo)

Reply via email to