| 1 |
// PR c++/56611 |
| 2 |
// { dg-do compile { target c++11 } } |
| 3 |
|
| 4 |
template<class T> struct remove_reference { typedef T type; }; |
| 5 |
template<class T> struct remove_reference<T&> { typedef T type; }; |
| 6 |
template<class T> T declval() { return T(); } |
| 7 |
|
| 8 |
int f(int, int){return 0;} |
| 9 |
struct Func{}; |
| 10 |
|
| 11 |
template<class... Args> using result2 |
| 12 |
= decltype(f(declval<typename remove_reference<Args>::type>()...)); |
| 13 |
|
| 14 |
template<class Sig> struct R; |
| 15 |
template<class This, class... Args> struct R< This(Args...) > |
| 16 |
{ |
| 17 |
typedef result2<Args...> type; |
| 18 |
}; |
| 19 |
|
| 20 |
typedef R< Func(int, int) >::type R_type; |