// { dg-do run { target c++20 } } template constexpr bool is_same_v = false; template constexpr bool is_same_v = true; template concept Same = is_same_v; template concept Diff = requires(T& t, U& u) { u - t; }; template int distance(I, S) { return 0; } template S> int distance(I first, S last) { return last - first; } template struct I { template requires Same friend int operator-(I const&, I const&) { static_assert(Same); return 42; } }; int main() { return distance(I{}, I{}); }