| 1 |
// PR c++/123667 |
| 2 |
// { dg-do compile { target c++14 } } |
| 3 |
// { dg-options "" } |
| 4 |
|
| 5 |
namespace std { |
| 6 |
template <typename T> struct tuple_size; |
| 7 |
template <int, typename> struct tuple_element; |
| 8 |
} |
| 9 |
|
| 10 |
struct A { |
| 11 |
int i; |
| 12 |
template <int I> int &get () { return i; } |
| 13 |
}; |
| 14 |
|
| 15 |
template <> struct std::tuple_size <A> { static const int value = 2; }; |
| 16 |
template <int I> struct std::tuple_element <I,A> { using type = int; }; |
| 17 |
|
| 18 |
int |
| 19 |
main () |
| 20 |
{ |
| 21 |
auto [ x, y ] = A { 0 }; // { dg-warning "structured bindings only available with" "" { target c++14_down } } |
| 22 |
[] (auto t) { using z = decltype (x); } (1); |
| 23 |
} |