| 1 |
// PR c++/108474 |
| 2 |
// { dg-do link { target c++17 } } |
| 3 |
|
| 4 |
namespace std { |
| 5 |
template <typename T> struct tuple_size; |
| 6 |
template <int, typename> struct tuple_element; |
| 7 |
} |
| 8 |
|
| 9 |
struct A { |
| 10 |
int i; |
| 11 |
template <int I> int& get() { return i; } |
| 12 |
}; |
| 13 |
|
| 14 |
template <> struct std::tuple_size <A> { static const int value = 2; }; |
| 15 |
template <int I> struct std::tuple_element <I, A> { using type = int; }; |
| 16 |
|
| 17 |
struct A a; |
| 18 |
auto [i, j] = a; |
| 19 |
int &r = i; |
| 20 |
int s = i; |
| 21 |
int *t = &i; |
| 22 |
|
| 23 |
void |
| 24 |
foo (int **p, int *q) |
| 25 |
{ |
| 26 |
static int &u = i; |
| 27 |
static int v = i; |
| 28 |
static int *w = &i; |
| 29 |
int &x = i; |
| 30 |
int y = i; |
| 31 |
int *z = &i; |
| 32 |
*p = &i; |
| 33 |
*q = i; |
| 34 |
} |
| 35 |
|
| 36 |
int |
| 37 |
main () |
| 38 |
{ |
| 39 |
} |