comparison gcc/testsuite/g++.dg/coroutines/pr9xxxx-mismatched-traits-and-promise-prev.C @ 19:2b5abeee2509 default tip

update gcc11
author anatofuz
date Mon, 25 May 2020 07:50:57 +0900
parents
children
comparison
equal deleted inserted replaced
18:1830386684a0 19:2b5abeee2509
1 // { dg-do compile { target c++17 } }
2
3 #include "coro.h"
4
5 // Test that we get matching types to traits and promise param
6 // preview.
7
8 // A separate issue from allowing non-class return types.
9 struct Fake {} ;
10
11 template<typename R, typename CallOp, typename ...T>
12 struct std::coroutine_traits<R, CallOp, T...> {
13 struct promise_type {
14 promise_type (CallOp op, T ...args) {}
15 Fake get_return_object() { return {}; }
16 std::suspend_always initial_suspend() { return {}; }
17 std::suspend_never final_suspend() { return {}; }
18 void return_void() {}
19 void unhandled_exception() {}
20 };
21 };
22
23
24 struct Foo
25 {
26 Fake operator() (int a) {
27 co_return;
28 }
29 };