[clang] Concept can access a private type in a dependent template (original) (raw)

This code compiles just fine although it shouldn't

#include

template class trait { using type = int; // note that the type is private };

template concept has_field = requires(T t) { { t.field } -> std::convertible_to<typename trait::type>; };

struct foo { int field; };

static_assert(has_field);

https://godbolt.org/z/WKzo7E7cK