https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125830
--- Comment #1 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jakub Jelinek <[email protected]>: https://gcc.gnu.org/g:4bf11aca586c9eef753b6f76d29ae19e1b505694 commit r17-4857-g4bf11aca586c9eef753b6f76d29ae19e1b505694 Author: Jakub Jelinek <[email protected]> Date: Sat Oct 3 21:30:31 2026 +0200 c++: Implement C++29 P3950R1 - return_value & return_void Are Not Mutually Exclusive paper as DR [PR125830] The following patch attempts to implement this paper by dropping the coroutine diagnostics about both return_void and return_value. Also, I've added complain argument to some functions, because https://eel.is/c++draft/stmt.return.coroutine#3 now says If overload resolution for p.return_void() succeeds, ... So, we shouldn't error in any way if p.return_void() overload resolution fails. 2026-10-03 Jakub Jelinek <[email protected]> P3950R1 PR c++/125830 * c-cppbuiltin.cc (c_cpp_builtins): Bump __cpp_impl_coroutine from 201902L to 202606L. * coroutines.cc: Implement C++29 P3950R1 - return_value & return_void Are Not Mutually Exclusive paper as DR. (struct coroutine_info): Remove coro_co_return_error_emitted member. (coro_promise_type_found_p): Remove diagnostics about both return_void and return_value successful lookup. (lookup_promise_method): Add complain argument, pass it down to lookup_member. (coro_build_promise_expression): Add complain argument, pass it down to lookup_promise_method, build_new_method_call and build_class_member_access_expr. (get_coroutine_return_void_expr): Pass tf_none to coro_build_promise_expression. * g++.dg/DRs/dr2581-2.C (__cpp_impl_coroutine): Redefine to 202606L rather than 201902L. * g++.dg/coroutines/pr105301.C: Change dg-error to dg-bogus. * g++.dg/coroutines/coro-pre-proc.C: Expect different value of __cpp_impl_coroutine. * g++.dg/coroutines/pr97438.C: Change dg-error to dg-bogus. * g++.dg/coroutines/p3950r1.C: New test. Reviewed-by: Jason Merrill <[email protected]>
