gcc/testsuite/g++.dg/concepts/fn4.C
raw| 1 | // { dg-do compile { target c++17 } } |
| 2 | // { dg-options "-fconcepts" } |
| 3 | |
| 4 | template<typename T> |
| 5 | concept C = __is_class(T); |
| 6 | |
| 7 | template<typename T> |
| 8 | concept D = C<T> and __is_empty(T); |
| 9 | |
| 10 | struct S1 { } s1; |
| 11 | struct S2 { int n; } s2; |
| 12 | |
| 13 | template<C T> void f1(T x) { } |
| 14 | template<D T> void f1(T x) { } |
| 15 | |
| 16 | int main() { |
| 17 | f1(0); // { dg-error "matching" } |
| 18 | } |