// { dg-do compile { target c++11 } } // { dg-options "" } namespace std { template struct tuple_size; template struct tuple_element; } struct A { int i; template int& get() { return i; } }; template<> struct std::tuple_size { static const int value = 3; }; template struct std::tuple_element { using type = int; }; struct B { int i, j; long long k, l; } z[6]; void foo (A &a, B &b) { auto [ c [[]], d, e [[maybe_unused]] ] = a; // { dg-warning "structured bindings with attributed identifiers only available with" "" { target { c++17 && c++23_down } } } // { dg-warning "structured bindings only available with" "" { target c++14_down } .-1 } auto [ f, h [[maybe_unused]] [[]], i [[]], j ] = b; // { dg-warning "structured bindings with attributed identifiers only available with" "" { target { c++17 && c++23_down } } } // { dg-warning "structured bindings only available with" "" { target c++14_down } .-1 } for (auto [ k, l [[maybe_unused]], m, n [[]]] : z) // { dg-warning "structured bindings with attributed identifiers only available with" "" { target { c++17 && c++23_down } } } ; // { dg-warning "structured bindings only available with" "" { target c++14_down } .-1 } auto &[o[[]][[]][[]], p[[]], q[[]]] = a; // { dg-warning "structured bindings with attributed identifiers only available with" "" { target { c++17 && c++23_down } } } ; // { dg-warning "structured bindings only available with" "" { target c++14_down } .-1 } }