c++, coroutines: Simplify separation of the user function body and ramp.
[official-gcc.git] / gcc / testsuite / g++.dg / cpp1y / lambda-generic-83856.C
blobe1f139406ca3a41a2dcee9962fa387d638d1c3eb
1 // PR c++/83856
2 // { dg-do compile { target c++14 } }
4 namespace std {
5 template <typename _Tp> _Tp declval();
6 template <class _E> class initializer_list {
7   _E *_M_len;
9 public:
10   __SIZE_TYPE__ size;
11   _E begin();
13 template <typename, unsigned> struct array { void operator[](long); };
14 } // namespace std
16 template <class> struct simd {
17   static int size();
18   template <class F> simd(F, decltype(std::declval<F>()(0)) * = nullptr) {}
20 template <class V, class... F>
21 void test_tuples(std::initializer_list<std::array<float, 1>> data,
22                  F... fun_pack) {
23   auto it = data.begin();
24   const int remaining = V::size();
25   [](...) {}((fun_pack([&](auto) { it[remaining]; }), 0)...);
28 void f() {
29   test_tuples<simd<float>>({}, [](simd<float>) {});