Version 1.1 of ais/ai-00423.txt

Unformatted version of ais/ai-00423.txt version 1.1
Other versions for file ais/ai-00423.txt

!standard 8.5.1(4)          05-03-30 AI95-00423/01
!standard 8.5.4(4)
!class amendment 05-03-30
!status work item 05-03-30
!status received 05-03-30
!priority High
!difficulty Easy
!subject Renaming and null exclusion
!summary
(See proposal.)
!problem
At the Paris meeting, we came up with strangely inconsistent decisions regarding the interaction of not null with renamings:
1 - For object renamings, we said that "not null" is not permitted under any circumstances in the access_definition of the object_renaming_definition. (AI95-00409)
2 - For subprogram renamings, we said that "not null" is permitted, but is essentially ignored (like any subtype-ish property). (AI95-00404)
The first rule has the peculiar consequence that it prevents the user from "telling the truth", something that we try to encourage. Consider:
X : not null access Integer := ...; Y : access Integer renames X;
while Y is really of a null-excluding subtype, the user cannot write an explicit null exclusion. This is unfortunate, as we would like the user to be able to put the "correct subtype" here.
!proposal
Allow an explicit null exclusion in object and subprogram renamings, but only if it doesn't lie.
!wording
Remove the syntax rule added by AI95-00409 after 8.5.1(2/2) (that's the one which make a null exclusion illegal).
Add after 8.5.1(4):
In the case of an object_renaming_declaration with an access_definition, a null_exclusion shall only appear in the access_definition if the subtype of the object_name excludes null.
Add after 8.5.4(4):
For a parameter or result type of the subprogram_specification, a null_exclusion shall only appear if the subtype of the corresponding parameter or result type of the renamed callable entity excludes null.
!discussion
(See proposal.)
!example
--!corrigendum
!ACATS test
!appendix

*************************************************************

Questions? Ask the ACAA Technical Agent