aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp2a/concepts-pr84810.C
blob: 8d7cb89f3f5905f91af8f321e02a1868c762f509 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
// { dg-do compile { target c++20 } }
template<class> constexpr bool is_int = false;
template<> constexpr bool is_int<int> = true;

template <class T>
concept Int = is_int<T>;

int main() {
    auto x = []<Int T>(T t) { return 42; };
    auto y = x(42);
    auto z = x(""); // { dg-error "no match" }
    return z;
}