| 1 |
// PR c++/66712 |
| 2 |
// { dg-do compile { target c++17 } } |
| 3 |
// { dg-options "-fconcepts" } |
| 4 |
|
| 5 |
template <class T, class...Args> |
| 6 |
concept _Constructible_ = |
| 7 |
requires (Args&&...args) |
| 8 |
{ |
| 9 |
T{ ((Args&&)(args))... }; |
| 10 |
}; |
| 11 |
|
| 12 |
template <class T, class...Args> |
| 13 |
constexpr bool _constructible_() { return false; } |
| 14 |
|
| 15 |
template<typename T, typename... Args> |
| 16 |
requires _Constructible_<T, Args...> |
| 17 |
constexpr bool _constructible_() { return true; } |
| 18 |
|
| 19 |
struct S |
| 20 |
{ |
| 21 |
S(int, char const *); |
| 22 |
}; |
| 23 |
|
| 24 |
int main() |
| 25 |
{ |
| 26 |
static_assert(_constructible_<S, int, char const *>(), ""); |
| 27 |
} |