// Verify we diagnose constraint recursion. // PR c++/96840 // { dg-do compile { target c++20 } } template concept C = requires(T t, U u) { t * u; }; // { dg-message "required for the satisfaction of 'C' .with T = Int; Rep = int." "" { target *-*-* } .-1 } // { dg-error "depends on itself" "" { target *-*-* } .-2 } template struct Int { Int(); // make the class non-aggregate in light of PR99599 fix template requires C friend void operator*(T, Int) { } template requires C friend void operator*(Int, T) { } }; void f() { 0 * Int{}; }