| 1 |
// PR c++/94628 |
| 2 |
// A variant of variadic101.C where the recursive call to deref |
| 3 |
// has its first template argument explicitly provided. |
| 4 |
// { dg-do compile { target c++11 } } |
| 5 |
|
| 6 |
template<class T> |
| 7 |
struct Container |
| 8 |
{ T f() const; }; |
| 9 |
|
| 10 |
template<class T> |
| 11 |
T deref(const T& t) |
| 12 |
{ return t; } |
| 13 |
|
| 14 |
|
| 15 |
template <class T, class... Args> |
| 16 |
auto |
| 17 |
deref(const T& u, int r, Args... args) |
| 18 |
-> decltype(deref(u.f(), args...)) |
| 19 |
{ return deref<decltype(u.f())>(u.f(), args...); } |
| 20 |
|
| 21 |
int main(void) |
| 22 |
{ |
| 23 |
Container<Container<int>> v; |
| 24 |
deref(v,1,2); |
| 25 |
} |