| 1 |
// { dg-do compile { target c++20 } } |
| 2 |
// { dg-additional-options "-fconcepts" } |
| 3 |
|
| 4 |
namespace zero |
| 5 |
{ |
| 6 |
template<int... s> |
| 7 |
struct S |
| 8 |
{ |
| 9 |
template<int... f> |
| 10 |
requires(... and (s == f)) |
| 11 |
static void F() |
| 12 |
{ |
| 13 |
} |
| 14 |
}; |
| 15 |
|
| 16 |
void foo(S<>) {} |
| 17 |
} |
| 18 |
|
| 19 |
namespace one |
| 20 |
{ |
| 21 |
template<typename X, typename Y> concept Foo = true; |
| 22 |
|
| 23 |
template<typename... T> |
| 24 |
struct foo |
| 25 |
{ |
| 26 |
template<typename... U> |
| 27 |
foo(U...) |
| 28 |
requires (Foo<T, U> && ...) |
| 29 |
{} |
| 30 |
}; |
| 31 |
|
| 32 |
void bar(foo<int, long, double>) {} |
| 33 |
} |
| 34 |
|