gcc/testsuite/g++.dg/cpp2a/concepts-nondep4.C
raw| 1 | // PR c++/99599 |
| 2 | // { dg-do compile { target c++20 } } |
| 3 | |
| 4 | struct foo_tag { }; |
| 5 | struct bar_tag { }; |
| 6 | |
| 7 | template<class T> |
| 8 | concept fooable = requires(T it) { invoke_tag(foo_tag{}, it); }; |
| 9 | |
| 10 | template<class T> void invoke_tag(foo_tag, T); |
| 11 | template<class T> void invoke_tag(bar_tag, T) requires fooable<T>; |
| 12 | |
| 13 | int main() { |
| 14 | invoke_tag(foo_tag{}, 0); |
| 15 | invoke_tag(bar_tag{}, 0); |
| 16 | } |