| 1 |
// PR c++/84031 |
| 2 |
// { dg-do compile { target c++11 } } |
| 3 |
// { dg-options "" } |
| 4 |
|
| 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; }; |
| 9 |
|
| 10 |
int |
| 11 |
main () |
| 12 |
{ |
| 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, ""); |
| 19 |
} |