PR c++/85210
[official-gcc.git] / gcc / testsuite / g++.dg / cpp1z / decomp42.C
blobc01db7f5d25f7256fbdb4f4b9c403bea5a91c822
1 // PR c++/85210
2 // { dg-do compile { target c++11 } }
3 // { dg-options "" }
5 struct A { int i; };
7 template <int>
8 void
9 foo (int j)
11   auto [j] = A{j};      // { dg-error "shadows a parameter" }
12 }                       // { dg-warning "structured bindings only available with" "" { target c++14_down } .-1 }
14 void
15 bar ()
17   foo<0> (0);