coroutines: Accept 'extern "C"' coroutines.
authorIain Sandoe <iain@sandoe.co.uk>
Sat, 10 Dec 2022 11:31:26 +0000 (11:31 +0000)
committerIain Sandoe <iain@sandoe.co.uk>
Tue, 20 Dec 2022 19:31:47 +0000 (19:31 +0000)
commita6504f13a0509f3937bdcdf63bf76bed7d880b72
tree164d61bea4ad68da6ac0ba0308f8ed39a0220440
parent49b6b7ac3314843466395c4a194aa178c80e64f5
coroutines: Accept 'extern "C"' coroutines.

'extern "C"' coroutines are permitted by the standard and expected to work
(although constructing useful cases could be challenging). In order to
permit this we need to arrange for the outlined helper functions to be
named properly, even when no mangling is required.  To do this, we append
the actor and destroy suffixes in all cases.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
gcc/cp/ChangeLog:

* mangle.cc (write_mangled_name): Append the helper function
suffixes here...
(write_encoding): ... rather than here.

gcc/testsuite/ChangeLog:

* g++.dg/coroutines/torture/extern-c-coroutine.C: New test.
gcc/cp/mangle.cc
gcc/testsuite/g++.dg/coroutines/torture/extern-c-coroutine.C [new file with mode: 0644]