aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp2a/concepts-lambda12.C
blob: 2bc9fd0bb25ed31379201d1fedcbb0a932af1190 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// PR c++/92633
// { dg-do compile { target c++20 } }

template<class A, class B>
concept different_than = !__is_same_as(A, B);

template<class B>
auto diff(B) {
    return [](different_than<B> auto a) {};
}

int main() {
    diff(42)("");
    diff(42)(42); // { dg-error "no match" }
}