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

--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Iain D Sandoe <ia...@gcc.gnu.org>:

https://gcc.gnu.org/g:b003c4b14b3f889e6707db68d2c6545eda7a203b

commit r11-4076-gb003c4b14b3f889e6707db68d2c6545eda7a203b
Author: Iain Sandoe <i...@sandoe.co.uk>
Date:   Sat Oct 17 11:21:11 2020 +0100

    coroutines: Emit error for invalid promise return types [PR97438].

    At one stage, use cases were proposed for allowing the promise
    type to contain both return_value and return_void.  That was
    not accepted into C++20, so we should reject it as per the PR.

    gcc/cp/ChangeLog:

            PR c++/97438
            * coroutines.cc (struct coroutine_info): Add a field to
            record that we emitted a promise type error.
            (coro_promise_type_found_p): Check for the case that the
            promise type contains both return_void and return_value.
            Emit an error if so, with information about the wrong
            type methods.

    gcc/testsuite/ChangeLog:

            PR c++/97438
            * g++.dg/coroutines/pr97438.C: New test.

Reply via email to