Ada 2012 Reference Manual
3.11 Declarative Parts
A declarative_part contains declarative_items (possibly none).
Syntax
Static Semantics
The list of declarative_items of a declarative_part is called the declaration list of the declarative_part.
Dynamic Semantics
The elaboration of a declarative_part consists of the elaboration of the declarative_items, if any, in the order in which they are given in the declarative_part.
An elaborable construct is in the elaborated state after the normal completion of its elaboration. Prior to that, it is not yet elaborated.
For a construct that attempts to use a body, a check (Elaboration_Check) is performed, as follows:
- For a call to a (non-protected) subprogram that has an explicit body, a check is made that the body is already elaborated. This check and the evaluations of any actual parameters of the call are done in an arbitrary order.
- For a call to a protected operation of a protected type (that has a body — no check is performed if the protected type is imported — see B.1), a check is made that the protected_body is already elaborated. This check and the evaluations of any actual parameters of the call are done in an arbitrary order.
- For the activation of a task, a check is made by the activator that the task_body is already elaborated. If two or more tasks are being activated together (see 9.2), as the result of the elaboration of a declarative_part or the initialization for the object created by an allocator, this check is done for all of them before activating any of them.
- For the instantiation of a generic unit that has a body, a check is made that this body is already elaborated. This check and the evaluation of any explicit_generic_actual_parameters of the instantiation are done in an arbitrary order.
The exception Program_Error is raised if any of these checks fails.