2018-11-07 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / g++.dg / cpp1z / decomp22.C
blob9e6b8df486a85cb6a2943a7660211af475c97b69
1 // PR c++/79205
2 // { dg-do compile { target c++11 } }
3 // { dg-options "" }
5 template <unsigned long, typename...> struct B;
6 template <unsigned long I, typename H> struct B<I, H> { int b; };
7 template <typename... E> struct C { B<0, E...> c; C (C &) = default; C (C &&); };
8 template <typename> struct tuple_size;
9 template <> struct tuple_size<C<int>> { static constexpr int value = 1; };
10 template <int, typename> struct tuple_element;
11 template <typename H, typename... T>
12 struct tuple_element<0, C<H, T...>> { typedef int type; };
13 template <int, typename... E>
14 int &&get (C<E...> &&);
16 int
17 foo (C<int> t)
19   auto[x0] = t; // { dg-warning "structured bindings only available with" "" { target c++14_down } }
20   return x0;