| 1 |
// PR c++/93286 |
| 2 |
// { dg-do compile { target c++14 } } |
| 3 |
|
| 4 |
struct A { static const bool value = true; }; |
| 5 |
template <bool> using __bool_constant = A; |
| 6 |
template <typename... _Args> |
| 7 |
struct B : __bool_constant<__is_constructible(int, _Args...)> {}; |
| 8 |
template <bool> using enable_if_t = int; |
| 9 |
template <typename... _Args> bool is_constructible_v = B<_Args...>::value; |
| 10 |
class C { |
| 11 |
template <typename _Tp, typename = enable_if_t<is_constructible_v<_Tp>>> |
| 12 |
C(_Tp &&); |
| 13 |
}; |
| 14 |
using Effect_t = C; |
| 15 |
void fn1(Effect_t effect) { |
| 16 |
int i; |
| 17 |
[](int &effect) {}(i); |
| 18 |
} |