1 // PR c++/97878 2 // { dg-do compile { target c++11 } } 3 // { dg-options "" } 4 5 extern int a[]; 6 auto [b] { a }; // { dg-error "has incomplete type" } 7 // { dg-warning "only available with" "" { target c++14_down } .-1 } 8 auto [c] = a; // { dg-error "has incomplete type" } 9 // { dg-warning "only available with" "" { target c++14_down } .-1 } 10 extern int d[0]; 11 auto [e] { d }; // { dg-error "too many initializers for" } 12 // { dg-error "1 name provided for structured binding" "" { target *-*-* } .-1 } 13 // { dg-message "decomposes into 0 elements" "" { target *-*-* } .-2 } 14 // { dg-warning "only available with" "" { target c++14_down } .-3 } 15 auto [f] = d; // { dg-error "1 name provided for structured binding" } 16 // { dg-message "decomposes into 0 elements" "" { target *-*-* } .-1 } 17 // { dg-warning "only available with" "" { target c++14_down } .-2 } 18