https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105301
--- Comment #4 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:6cae3bb65c873a2191613f7888fe949553a21f9e commit r12-8309-g6cae3bb65c873a2191613f7888fe949553a21f9e Author: Iain Sandoe <i...@sandoe.co.uk> Date: Mon Apr 18 09:21:52 2022 +0100 c++, coroutines: Account for overloaded promise return_value() [PR105301]. Whether it was intended or not, it is possible to define a coroutine promise with multiple return_value() methods [which need not even have the same type]. We were not accounting for this possibility in the check to see whether both return_value and return_void are specifier (which is prohibited by the standard). Fixed thus and provided an adjusted diagnostic for the case that multiple return_value() methods are present. Signed-off-by: Iain Sandoe <i...@sandoe.co.uk> PR c++/105301 gcc/cp/ChangeLog: * coroutines.cc (coro_promise_type_found_p): Account for possible mutliple overloads of the promise return_value() method. gcc/testsuite/ChangeLog: * g++.dg/coroutines/pr105301.C: New test.