gcc/testsuite/g++.dg/cpp2a/concepts-explicit-spec5.C
raw| 1 | // { dg-do compile { target c++20 } } |
| 2 | // { dg-skip-if "requires hosted libstdc++ for cassert" { ! hostedlib } } |
| 3 | |
| 4 | #include <cassert> |
| 5 | |
| 6 | template<typename T> |
| 7 | concept C = __is_class(T); |
| 8 | |
| 9 | template<typename T> |
| 10 | concept D = C<T> && __is_empty(T); |
| 11 | |
| 12 | struct X { } x; |
| 13 | struct Y { int n; } y; |
| 14 | |
| 15 | int called = 0; |
| 16 | |
| 17 | template<typename T> |
| 18 | struct S { |
| 19 | void f() requires C<T>; |
| 20 | }; |
| 21 | |
| 22 | template<> void S<int>::f() { called = 1; } // { dg-error "match" } |