This is the mail archive of the
gcc-cvs@gcc.gnu.org
mailing list for the GCC project.
r278442 - in /branches/c++-coroutines: ChangeLo...
- From: iains at gcc dot gnu dot org
- To: gcc-cvs at gcc dot gnu dot org
- Date: Tue, 19 Nov 2019 11:56:43 -0000
- Subject: r278442 - in /branches/c++-coroutines: ChangeLo...
Author: iains
Date: Tue Nov 19 11:56:42 2019
New Revision: 278442
URL: https://gcc.gnu.org/viewcvs?rev=278442&root=gcc&view=rev
Log:
c++-coroutines - Fix an code-gen error in coro_maybe_expand_co_return.
When we are presented with 'co_return (void) expression;' we should
generate:
(void) expression;
p.return_void();
When we are presented with a non-void expression we should generate:
p.return_value(expression);
We were incorrectly generating
expression;
p.return_value(expression);
in the second case, fixed by checking that expression is VOID type
before inserting it.
2019-11-19 Iain Sandoe <iain@sandoe.co.uk>
gcc/cp/
* coroutines.cc (coro_maybe_expand_co_return): Ensure that an
expression is void type before inserting it. Update comments
to include the standard section refs.
gcc/testsuite/
* g++.dg/coroutines/torture/co-ret-10.C: New test.
* g++.dg/coroutines/torture/co-ret-7.C: Check that the void
expression is called exactly once.
Added:
branches/c++-coroutines/gcc/testsuite/g++.dg/coroutines/torture/co-ret-10.C
Modified:
branches/c++-coroutines/ChangeLog.coroutines
branches/c++-coroutines/gcc/cp/coroutines.cc
branches/c++-coroutines/gcc/testsuite/g++.dg/coroutines/torture/co-ret-7.C