Next: , Previous: Pragma Postcondition, Up: Implementation Defined Pragmas


Pragma Post_Class

Syntax:

     pragma Post_Class (Boolean_Expression);

The Post_Class pragma is intended to be an exact replacement for the language-defined Post'Class aspect, and shares its restrictions and semantics. It must appear either immediately following the corresponding subprogram declaration (only other pragmas may intervene), or if there is no separate subprogram declaration, then it can appear at the start of the declarations in a subprogram body (preceded only by other pragmas).

Note: This pragma is called Post_Class rather than Post'Class because the latter would not be strictly conforming to the allowed syntax for pragmas. The motivation for provinding pragmas equivalent to the aspects is to allow a program to be written using the pragmas, and then compiled if necessary using an Ada compiler that does not recognize the pragmas or aspects, but is prepared to ignore the pragmas. The assertion policy that controls this pragma is Post'Class, not Post_Class.