| 1 |
// { dg-do compile { target c++11 } } |
| 2 |
template<typename T1, typename T2> |
| 3 |
struct pair {}; |
| 4 |
|
| 5 |
template<typename... Args> |
| 6 |
struct tuple { |
| 7 |
static const int value = 0; |
| 8 |
}; |
| 9 |
|
| 10 |
template<> |
| 11 |
struct tuple<pair<int, float> > { |
| 12 |
static const int value = 1; |
| 13 |
}; |
| 14 |
|
| 15 |
template<typename U> |
| 16 |
struct tuple<pair<int, U> > { |
| 17 |
static const int value = 2; |
| 18 |
}; |
| 19 |
|
| 20 |
template<typename T, typename U> |
| 21 |
struct tuple<pair<T, U>, pair<T, U> > { |
| 22 |
static const int value = 3; |
| 23 |
}; |
| 24 |
|
| 25 |
|
| 26 |
template<typename... Outer> |
| 27 |
struct X { |
| 28 |
template<typename... Inner> |
| 29 |
struct Y |
| 30 |
{ |
| 31 |
typedef tuple<pair<Outer, Inner>...> type; |
| 32 |
}; |
| 33 |
}; |
| 34 |
|
| 35 |
int a0[X<int, double>::Y<short, char>::type::value == 0? 1 : -1]; |
| 36 |
int a1[X<int>::Y<float>::type::value == 1? 1 : -1]; |
| 37 |
int a2[X<int>::Y<double>::type::value == 2? 1 : -1]; |
| 38 |
int a3[X<int, int>::Y<double, double>::type::value == 3? 1 : -1]; |