| 1 |
// { dg-do compile { target c++17 } } |
| 2 |
// { dg-options "-fconcepts" } |
| 3 |
|
| 4 |
// distilled from <concepts>, via header units |
| 5 |
|
| 6 |
template<typename _ArgTypes> |
| 7 |
struct is_invocable; |
| 8 |
|
| 9 |
template<typename... _Args> |
| 10 |
concept invocable = is_invocable<_Args...>::value; |
| 11 |
|
| 12 |
template<typename _Is> |
| 13 |
requires invocable<_Is> |
| 14 |
class BUG; |
| 15 |
|
| 16 |
template<typename _Is> |
| 17 |
requires invocable<_Is> |
| 18 |
class BUG {}; // { dg-bogus "different constraints" } |
| 19 |
|
| 20 |
template<int> struct is_invocable_NT; |
| 21 |
|
| 22 |
template<int... Ints> |
| 23 |
concept invocable_NT = is_invocable_NT<Ints...>::value; |
| 24 |
|
| 25 |
template<int _Is> |
| 26 |
requires invocable_NT<_Is> |
| 27 |
class BUG_NT; |
| 28 |
|
| 29 |
template<int _Is> |
| 30 |
requires invocable_NT<_Is> |
| 31 |
class BUG_NT {}; |