Declarations in VHDL-2019 std library use constant access types, which are not allowed
Description
The following declarations in the VHDL-2019 std.env
package (in addition to DIR_OPEN
due to a typo, #59, and including one already reported in #98):
procedure DIR_CLOSE(Dir : in DIRECTORY);
impure function TO_STRING (call_path : CALL_PATH_ELEMENT ) return STRING;
impure function TO_STRING (call_path : CALL_PATH_VECTOR; Separator : STRING := "" & LF ) return STRING;
impure function TO_STRING (call_path : CALL_PATH_VECTOR_PTR; Separator : STRING := "" & LF ) return STRING;
all have a formal parameter of a composite type that contains an access type (DIRECTORY
, CALL_PATH_ELEMENT
, CALL_PATH_VECTOR
and CALL_PATH_VECTOR_PTR
respectively). These parameters are of mode in
(implicitly or explicitly) and have no explicit object class, so according to LRM08 4.2.2.1 Formal parameter lists, they default to constant
:
If the mode is in and no object class is explicitly specified, constant is assumed.
LRM08 6.5.2 Interface object declarations has the following to say about interface constant declarations:
For an interface constant declaration (other than a formal parameter of the predefined = or /= operator for an access type) or an interface signal declaration, the subtype indication shall define a subtype that is neither a file type, an access type, nor a protected type. Moreover, the subtype indication shall not denote a composite type with a subelement that is of an access type.
As far as I'm aware, neither of these paragraphs have undergone relevant changes with VHDL-2019, putting the above declarations in conflict with the standard.
A possible solution for this would be to give the parameters an explicit object class of variable
.
Another solution would be to allow constants of access types, see #232.