libstdc++: Define noop coroutine details private and inline [PR 95917]
authorJonathan Wakely <jwakely@redhat.com>
Tue, 20 Oct 2020 10:19:58 +0000 (11:19 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Tue, 20 Oct 2020 10:37:48 +0000 (11:37 +0100)
commit94fd05f1f76faca9dc9033b55d44c960155d38e9
tree080d00360063e63b229428aa703171277c8b326d
parent2c2278f300cdd5f3181fe7df4dd1d869a67266a9
libstdc++: Define noop coroutine details private and inline [PR 95917]

This moves the __noop_coro_frame type, the __noop_coro_fr global
variable, and the __dummy_resume_destroy function from namespace scope,
replacing them with private members of the specialization
coroutine_handle<noop_coroutine_promise>.

The function and variable are also declared inline, so that they
generate no code unless used.

libstdc++-v3/ChangeLog:

PR libstdc++/95917
* include/std/coroutine (__noop_coro_frame): Replace with
noop_coroutine_handle::__frame.
(__dummy_resume_destroy): Define inline in __frame.
(__noop_coro_fr): Replace with noop_coroutine_handle::_S_fr
and define as inline.
* testsuite/18_support/coroutines/95917.cc: New test.
libstdc++-v3/include/std/coroutine
libstdc++-v3/testsuite/18_support/coroutines/95917.cc [new file with mode: 0644]