gcc/testsuite/g++.dg/cpp2a/concepts-nonbool1.C
raw| 1 | // PR c++/94186 |
| 2 | // { dg-do compile { target concepts } } |
| 3 | |
| 4 | template <typename T> |
| 5 | struct is_small |
| 6 | { |
| 7 | enum { value = sizeof(T) <= 4 }; |
| 8 | }; |
| 9 | |
| 10 | template <typename T> |
| 11 | requires is_small<T>::value // { dg-error "bool" } |
| 12 | void fun(T) {} |
| 13 | |
| 14 | template <typename T> |
| 15 | void fun(T) {} |
| 16 | |
| 17 | int main() |
| 18 | { |
| 19 | fun(1); // { dg-message "" } |
| 20 | } |