1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
// PR c++/92838 // { dg-do compile { target c++20 } } template<int N> auto foo() { [] () requires (N != 0) { }(); // { dg-error "no match" } [] () requires (N == 0) { }(); [] <int M=1> () requires (N == M) { }(); // { dg-error "no match" } [] <int M=1> () requires (N != M) { }(); } void bar() { foo<0>(); }