gcc/testsuite/g++.dg/cpp2a/concepts-recursive-sat2.C
raw| 1 | // { dg-do compile { target c++20 } } |
| 2 | |
| 3 | template<typename T> |
| 4 | concept Fooable = requires(T t) { foo(t); }; |
| 5 | // { dg-error "T = test::S]' depends on itself" "" { target *-*-* } .-1 } |
| 6 | |
| 7 | template<Fooable T> |
| 8 | void foo(T t) { } |
| 9 | |
| 10 | void test() |
| 11 | { |
| 12 | struct S {} s; |
| 13 | foo(s); // { dg-error "no match" } |
| 14 | } |