| 1 |
// PR c++/48319 |
| 2 |
// { dg-do compile { target c++11 } } |
| 3 |
// We were failing to recognize declval<_Args1> as dependent. |
| 4 |
|
| 5 |
template<typename Tp> Tp declval() noexcept; |
| 6 |
|
| 7 |
template<typename _Tp> |
| 8 |
class __is_constructible_helper |
| 9 |
{ |
| 10 |
typedef char __one; |
| 11 |
typedef struct { char __arr[2]; } __two; |
| 12 |
|
| 13 |
template<typename _Tp1, typename... _Args1> |
| 14 |
static decltype(_Tp1(declval<_Args1>()...), __one()) __test(int); |
| 15 |
|
| 16 |
template<typename, typename...> |
| 17 |
static __two __test(...); |
| 18 |
|
| 19 |
public: |
| 20 |
static const bool __value = sizeof(__test<_Tp>(0)) == 1; |
| 21 |
}; |
| 22 |
|
| 23 |
int main() { |
| 24 |
return __is_constructible_helper<int>::__value; |
| 25 |
} |