Mercurial > hg > CbC > CbC_gcc
view gcc/testsuite/g++.dg/coroutines/co-await-syntax-09-convert.C @ 158:494b0b89df80 default tip
...
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 25 May 2020 18:13:55 +0900 |
parents | 1830386684a0 |
children |
line wrap: on
line source
// { dg-additional-options "-std=c++17 -w" } #include "coro.h" class mycoro { public: class promise_type { public: std::suspend_always initial_suspend() const noexcept { return {}; } std::suspend_always final_suspend() const noexcept { return {}; } void unhandled_exception() noexcept { } mycoro get_return_object() { return mycoro{}; } }; }; class await { public: bool await_ready() const noexcept { return false; } bool await_suspend(std::coroutine_handle<>) noexcept {return true;} mycoro await_resume() { return mycoro{}; } }; mycoro foo(mycoro source) { (void) co_await await{}; }