blob: d90e665add0390bb7814f8583ea32f911bbbbd10 [file] [log] [blame]
// PR c++/79372
// { dg-do compile { target c++11 } }
// { dg-options "" }
template <typename T>
struct S
{
enum E { A };
void f () { auto [x] = 0; x++; } // { dg-error "cannot decompose non-array non-class type" }
// { dg-warning "structured bindings only available with" "" { target c++14_down } .-1 }
void g (T t) { auto [y] = t; y++; } // { dg-error "cannot decompose non-array non-class type" }
}; // { dg-warning "structured bindings only available with" "" { target c++14_down } .-1 }
int
main ()
{
S <int> s;
s.f ();
s.g (5);
}