blob: 44a629b13869e09c9c68d8ca84cb4a6ef356b632 [file] [log] [blame]
// { dg-additional-options "-fsyntax-only -w" }
// Diagose missing get_return_object() in the promise type.
#include "coro.h"
struct MissingGRO {
coro::coroutine_handle<> handle;
MissingGRO () : handle (nullptr) {}
MissingGRO (coro::coroutine_handle<> handle) : handle (handle) {}
struct missing_gro {
coro::suspend_never initial_suspend() { return {}; }
coro::suspend_never final_suspend() noexcept { return {}; }
void return_void () {}
void unhandled_exception() { /*std::terminate();*/ };
};
};
template<> struct coro::coroutine_traits<MissingGRO> {
using promise_type = MissingGRO::missing_gro;
};
MissingGRO
bar () // { dg-error {no member named 'get_return_object' in} }
{
co_return;
}
int main (int ac, char *av[]) {
MissingGRO x = bar ();
return 0;
}