diff options
author | Iain Sandoe <iain@sandoe.co.uk> | 2022-04-18 09:21:52 +0100 |
---|---|---|
committer | Iain Sandoe <iain@sandoe.co.uk> | 2022-04-28 13:52:23 +0100 |
commit | 6cae3bb65c873a2191613f7888fe949553a21f9e (patch) | |
tree | 57fc31ddc4712f710143fc12674510239e551fd2 /gcc/gcov-io.h | |
parent | 15a176a833f23e64ad38690a678bf938227ce46f (diff) | |
download | gcc-6cae3bb65c873a2191613f7888fe949553a21f9e.zip gcc-6cae3bb65c873a2191613f7888fe949553a21f9e.tar.gz gcc-6cae3bb65c873a2191613f7888fe949553a21f9e.tar.bz2 |
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 <iain@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.
Diffstat (limited to 'gcc/gcov-io.h')
0 files changed, 0 insertions, 0 deletions