Otherwise, letting
P be a program point whose immediate scope is the
function parameter scope, class scope, or namespace scope
corresponding to the
function, class, or namespace
represented by
ctx.scope():
If
r represents a direct base class relationship
(D,B),
then true if base class B of DESIGNATING-CLS(r, ctx)
is accessible at P ([class.access.base]);
otherwise false. [
Note 2:
The definitions of when a class member or base class is accessible from a point
P
do not consider whether a declaration of that entity is reachable from
P. —
end note]
Throws:
meta::exception if
r represents a class member
for which
PARENT-CLS(r) is an incomplete class
. [
Example 1:
consteval access_context fn() {
return access_context::current();
}
class Cls {
int mem;
friend consteval access_context fn();
public:
static constexpr auto r = ^^mem;
};
static_assert(is_accessible(Cls::r, fn();
static_assert(!is_accessible(Cls::r, access_context::current();
static_assert(is_accessible(Cls::r, access_context::unchecked();
—
end example]
consteval bool has_inaccessible_nonstatic_data_members(info r, access_context ctx);
Returns:
true if
is_accessible(R, ctx) is
false
for any
R in
nonstatic_data_members_of(r, access_context::unchecked(). Throws:
meta::exception if
- the evaluation of
nonstatic_data_members_of(r, access_context::unchecked()
would exit via an exception or
- r represents a closure type.
consteval bool has_inaccessible_bases(info r, access_context ctx);
Returns:
true if
is_accessible(R, ctx) is
false
for any
R in
bases_of(r, access_context::unchecked(). Throws:
meta::exception if the evaluation of
bases_of(r, access_context::unchecked()
would exit via an exception
. consteval bool has_inaccessible_subobjects(info r, access_context ctx);
Effects: Equivalent to:
return has_inaccessible_bases(r, ctx) || has_inaccessible_nonstatic_data_members(r, ctx);