// { dg-do compile { target c++20 } } template concept C = __is_class(T); template concept D = __is_empty(T); struct X { } x; struct Y { int n; } y; int called = 0; // Test constrained member definitions template struct S1 { // { dg-message "defined here" } void f1() requires C { } void g1() requires C and true; template void h1(U u) { called = 1; } void g2() requires C; // { dg-message "candidate" } }; template void S1::g2() requires D { } // { dg-error "no declaration matches" } int main() { S1 sx; S1 sy; S1 si; si.f1(); // { dg-error "matching" } si.g1(); // { dg-error "matching" } si.h1(0); // { dg-error "matching" } }