| 1 |
// PR c++/67427 |
| 2 |
// { dg-do compile { target c++20 } } |
| 3 |
// { dg-additional-options "-fconcepts" } |
| 4 |
|
| 5 |
template <bool... Values> struct and_c_impl { |
| 6 |
static constexpr bool value = true; |
| 7 |
}; |
| 8 |
|
| 9 |
template <bool ValueFirst, bool... ValuesRest> |
| 10 |
struct and_c_impl<ValueFirst, ValuesRest...> { |
| 11 |
static constexpr bool value = ValueFirst && and_c_impl<ValuesRest...>::value; |
| 12 |
}; |
| 13 |
|
| 14 |
template <bool... Values> constexpr bool and_c() { |
| 15 |
return and_c_impl<Values...>::value; |
| 16 |
} |
| 17 |
|
| 18 |
template<class T> concept C = true; |
| 19 |
|
| 20 |
template<class... Tx> |
| 21 |
struct A { |
| 22 |
A() requires (and_c<C<Tx>...>()) = default; |
| 23 |
}; |
| 24 |
|
| 25 |
int main() { |
| 26 |
A<int, double> a; |
| 27 |
return 0; |
| 28 |
} |