c++, coroutines: Simplify separation of the user function body and ramp.
[official-gcc.git] / gcc / testsuite / g++.dg / cpp1y / constexpr-101371.C
blobb6351b806b9898776275ee5fcbde7971951ac14a
1 // PR c++/101371
2 // { dg-do compile { target c++14 } }
4 struct A {
5   int i;
6 };
7 struct B {
8   A a{};
9   constexpr B() : a() {}
10   constexpr B(const B &rhs) : a(rhs.a) {}
12 struct C {
13   B arr[1];
16 struct X {
17   constexpr C fn () const
18   {
19     C c{};
20     return c;
21   }
24 void
25 g ()
27   X x;
28   constexpr auto z = x.fn();