This code compiles just fine although it shouldn't
#include <concepts>
template<typename T>
class trait
{
using type = int; // note that the type is private
};
template<typename T>
concept has_field = requires(T t) {
{ t.field } -> std::convertible_to<typename trait<T>::type>;
};
struct foo
{
int field;
};
static_assert(has_field<foo>);
https://godbolt.org/z/WKzo7E7cK