gcc/testsuite/g++.dg/cpp2a/concepts-pr84810.C
raw| 1 | // { dg-do compile { target c++20 } } |
| 2 | template<class> constexpr bool is_int = false; |
| 3 | template<> constexpr bool is_int<int> = true; |
| 4 | |
| 5 | template <class T> |
| 6 | concept Int = is_int<T>; |
| 7 | |
| 8 | int main() { |
| 9 | auto x = []<Int T>(T t) { return 42; }; |
| 10 | auto y = x(42); |
| 11 | auto z = x(""); // { dg-error "no match" } |
| 12 | return z; |
| 13 | } |