10.1.6 Environment-Level Visibility Rules
The normal visibility rules do not apply within a
parent_unit_name
or a
context_clause,
nor within a
pragma
that appears at the place of a compilation unit. The special visibility
rules for those contexts are given here.
Static Semantics
Within
the
parent_unit_name
at the beginning of an explicit
library_item,
and within a
nonlimited_with_clause,
the only declarations that are visible are those that are explicit
library_items
of the environment, and the only declarations that are directly visible
are those that are explicit root
library_items
of the environment. Within a
limited_with_clause,
the only declarations that are visible are those that are the implicit
declaration of the limited view of a library package of the environment,
and the only declarations that are directly visible are those that are
the implicit declaration of the limited view of a root library package.
Within
a
use_clause
or
pragma
that is within a
context_clause,
each
library_item
mentioned in a previous
with_clause
of the same
context_clause
is visible, and each root
library_item
so mentioned is directly visible. In addition, within such a
use_clause,
if a given declaration is visible or directly visible, each declaration
that occurs immediately within the given declaration's visible part is
also visible. No other declarations are visible or directly visible.
Within a
pragma that
appears at the place of a compilation unit, the immediately preceding
library_item
and each of its ancestors is visible. The ancestor root
library_item
is directly visible.
Notwithstanding the rules of
4.1.3, an expanded name in a
with_clause,
a
pragma in
a
context_clause,
or a
pragma
that appears at the place of a compilation unit may consist of a
prefix
that denotes a generic package and a
selector_name
that denotes a child of that generic package. (The child is necessarily
a generic unit; see
10.1.1.)