| 1 |
// PR c++/107773 |
| 2 |
// A variadic version of typename25.C |
| 3 |
// { dg-do compile { target c++11 } } |
| 4 |
|
| 5 |
struct a { |
| 6 |
typedef void type; |
| 7 |
}; |
| 8 |
|
| 9 |
struct c { |
| 10 |
struct b : a { |
| 11 |
typedef b self; |
| 12 |
static int m; |
| 13 |
}; |
| 14 |
int b; |
| 15 |
}; |
| 16 |
|
| 17 |
template<class...> void sink(...); |
| 18 |
|
| 19 |
template<class... Ts> |
| 20 |
void f() { |
| 21 |
// A TYPENAME_TYPE whose TYPE_CONTEXT is a nested TYPENAME_TYPE. |
| 22 |
sink<typename Ts::b::type...>(); |
| 23 |
// A SCOPE_REF whose first operand is a TYPENAME_TYPE. |
| 24 |
sink(Ts::b::m...); |
| 25 |
} |
| 26 |
|
| 27 |
template void f<c>(); |
| 28 |
|
| 29 |
template<class... Ts> |
| 30 |
struct d : Ts::b::self... { |
| 31 |
#if __cpp_variadic_using |
| 32 |
// A USING_DECL whose USING_DECL_SCOPE is a TYPENAME_TYPE. |
| 33 |
using typename Ts::b::type...; |
| 34 |
#endif |
| 35 |
}; |
| 36 |
|
| 37 |
template struct d<c>; |