Debian Codegraph @

gcc/testsuite/g++.dg/cpp1y/constexpr-101371.C

raw
1 // PR c++/101371
2 // { dg-do compile { target c++14 } }
3
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) {}
11 };
12 struct C {
13 B arr[1];
14 };
15
16 struct X {
17 constexpr C fn () const
18 {
19 C c{};
20 return c;
21 }
22 };
23
24 void
25 g ()
26 {
27 X x;
28 constexpr auto z = x.fn();
29 }