Section 4: Names and Expressions 4.1.3 Selected Components
4.9 Static Expressions and Static Subtypes Replace paragraph 26: [AI95-00263-01]
A static subtype is either a static scalar subtype or a static string subtype. A static scalar subtype is an unconstrained scalar subtype whose type is not a descendant of a formal scalar type, or a constrained scalar subtype formed by imposing a compatible static constraint on a static scalar subtype. A static string subtype is an unconstrained string subtype whose index subtype and component subtype are static (and whose type is not a descendant of a formal array type), or a constrained string subtype formed by imposing a compatible static constraint on a static string subtype. In any case, the subtype of a generic formal object of mode in out, and the result subtype of a generic formal function, are not static.
by:
A static subtype is either a static scalar subtype or a static string subtype. A static scalar subtype is an unconstrained scalar subtype whose type is not a descendant of a formal type, or a constrained scalar subtype formed by imposing a compatible static constraint on a static scalar subtype. A static string subtype is an unconstrained string subtype whose index subtype and component subtype are static, or a constrained string subtype formed by imposing a compatible static constraint on a static string subtype. In any case, the subtype of a generic formal object of mode in out, and the result subtype of a generic formal function, are not static.
Insert after paragraph 31: [AI95-00311-01]
• A discriminant constraint is static if each expression of the constraint is static, and the subtype of each discriminant is static.
the new paragraph:
In any case, the constraint of the first subtype of a scalar formal type is neither static nor null.
Replace paragraph 35: [AI95-00269-01]
• If the expression is not part of a larger static expression, then its value shall be in the base range of its expected type. Otherwise, the value may be arbitrarily large or small.
by:
• If the expression is not part of a larger static expression and the expression is expected to be of a single specific type, then its value shall be in the base range of its expected type. Otherwise, the value may be arbitrarily large or small.
Replace paragraph 37: [AI95-00269-01]
The last two restrictions above do not apply if the expected type is a descendant of a formal scalar type (or a corresponding actual type in an instance).
by:
The last restriction above does not apply if the expected type is a descendant of a formal scalar type (or a corresponding actual type in an instance).
In addition to the places where Legality Rules normally apply (see 12.3), the above restrictions also apply in the private part of an instance of a generic unit.
Replace paragraph 38: [AI95-00268-01; AI95-00269-01]
For a real static expression that is not part of a larger static expression, and whose expected type is not a descendant of a formal scalar type, the implementation shall round or truncate the value (according to the Machine_Rounds attribute of the expected type) to the nearest machine number of the expected type; if the value is exactly half-way between two machine numbers, any rounding shall be performed away from zero. If the expected type is a descendant of a formal scalar type, no special rounding or truncating is required - normal accuracy rules apply (see Annex G).
by:
For a real static expression that is not part of a larger static expression, and whose expected type is not a descendant of a formal scalar type, the implementation shall round or truncate the value (according to the Machine_Rounds attribute of the expected type) to the nearest machine number of the expected type; if the value is exactly half-way between two machine numbers, the rounding performed is implementation-defined. If the expected type is a descendant of a formal scalar type, or if the static expression appears in the body of an instance of a generic unit and the corresponding expression is nonstatic in the corresponding generic body, then no special rounding or truncating is required -- normal accuracy rules apply (see Annex G). Implementation Advice
For a real static expression that is not part of a larger static expression, and whose expected type is not a descendant of a formal scalar type, the rounding should be the same as the default rounding for the target system.
4.9.1 Statically Matching Constraints and Subtypes
Replace paragraph 1: [AI95-00311-01]A constraint statically matches another constraint if both are null constraints, both are static and have equal corresponding bounds or discriminant values, or both are nonstatic and result from the same elaboration of a constraint of a subtype_indication or the same evaluation of a range of a discrete_subtype_definition. by:
A constraint statically matches another constraint if:
• both are null constraints;
• both are static and have equal corresponding bounds or discriminant values;
• both are nonstatic and result from the same elaboration of a constraint of a subtype_indication or the same evaluation of a range of a discrete_subtype_definition; or
• both are nonstatic and both come from the same formal_type_declaration. Replace paragraph 2: [AI95-00231-01; AI95-00254-01]
A subtype statically matches another subtype of the same type if they have statically matching constraints. Two anonymous access subtypes statically match if their designated subtypes statically match.
by:
A subtype statically matches another subtype of the same type if they have statically matching constraints, and, for access subtypes, either both or neither exclude null. Two anonymous access-to-object subtypes statically match if their designated subtypes statically match, and either both or neither exclude null, and either both or neither are access-to-constant. Two anonymous access-to-subprogram subtypes statically match if their designated profiles are subtype conformant, and either both or neither exclude null.