// PR c++/92687 // { 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 = 2; }; template struct std::tuple_element { using type = int; }; template struct is_reference { static const bool value = false; }; template struct is_reference { static const bool value = true; }; template struct is_reference { static const bool value = true; }; template void foo () { auto [x, y] = A {}; // { dg-warning "structured bindings only available with" "" { target c++14_down } } static_assert (!is_reference::value, ""); } void bar () { auto [x, y] = A {}; // { dg-warning "structured bindings only available with" "" { target c++14_down } } static_assert (!is_reference::value, ""); } template void baz () { auto [x, y] = T {}; // { dg-warning "structured bindings only available with" "" { target c++14_down } } static_assert (!is_reference::value, ""); } void qux () { foo<0> (); baz (); }