2018-11-07 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / g++.dg / cpp1z / decomp36.C
blob5a66d0c7b56efe9627b001199d915423f582fdec
1 // PR c++/84031
2 // { dg-do compile { target c++11 } }
3 // { dg-options "" }
5 struct A { unsigned char : 1, a1 : 1, a2 : 2, : 1, a3 : 3; };
6 struct B { unsigned char : 1, : 7; };
7 struct C : B { constexpr C () : c1 (1), c2 (2), c3 (3) {} unsigned char : 1, c1 : 1, c2 : 2, : 1, c3 : 3; };
8 struct D : C { constexpr D () {} unsigned char : 1, : 7; };
10 int
11 main ()
13   static constexpr A a { 1, 2, 3 };
14   const auto &[a1, a2, a3] = a;         // { dg-warning "only available with" "" { target c++14_down } }
15   static_assert (a1 == 1 && a2 == 2 && a3 == 3, "");
16   static constexpr D d;
17   const auto &[d1, d2, d3] = d;         // { dg-warning "only available with" "" { target c++14_down } }
18   static_assert (d1 == 1 && d2 == 2 && d3 == 3, "");