| 1 |
// PR c++/118513 |
| 2 |
// { dg-additional-options -fmodule-header } |
| 3 |
// { dg-module-cmi {} } |
| 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 a, b; |
| 12 |
template <int I> int &get () { if (I == 0) return a; else return b; } |
| 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 |
namespace { |
| 19 |
auto [x, y] = A { 42, 43 }; |
| 20 |
} |