Mercurial > hg > CbC > CbC_gcc
view gcc/testsuite/g++.dg/coroutines/co-await-syntax-09-convert.C @ 145:1830386684a0
gcc-9.2.0
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 11:34:05 +0900 |
parents | |
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{}; }