Version 1.1 of ai12s/ai12-0427-1.txt

Unformatted version of ai12s/ai12-0427-1.txt version 1.1
Other versions for file ai12s/ai12-0427-1.txt

!standard 4.10(0/5)          21-05-07 AI12-0427-1/01
!class Amendment 21-05-07
!status Amendment 1-2012 21-05-07
!status work item 21-05-07
!status received 21-05-07
!priority Low
!difficulty Easy
!subject Fixups from WG 9 review
!summary
(1) Add rules about the subtypes of Put_Image and the propagation of exceptions from implicit calls to Put_Image.
!problem
(1) Stream-oriented attributes define the subtype of the parameter of the associated subprograms with 13.13.2(51/3). We don't have any similar rule for Put_Image in 4.10. The definition of Put_Image seems to suggest that the parameter is of type T, but type do not have names in Ada -- one always has to specify a subtype.
Additionally, the RM we doesn't mention that the implicit calls of Put_Image propagate any exceptions (including those caused by a subtype check failure).
!proposal
(1) Add appropriate wording.
!wording
(1) Add after 4.10(4/5):
For an aspect_specification or attribute_definition_clause specifying Put_Image, the subtype of the Arg parameter shall be the first subtype or the base subtype if scalar, and the first subtype if not scalar.
[Editor's note: This is really a Legality Rule, but we don't currently have such a section here. If we added one, the rule would be far away from the place where it makes sense. Note that stream-oriented attributes don't have Legality Rules section either.]
Add to the end of each of 4.10(28.2/5), 4.10(31/5), 4.10(34/5):
Redundant[Any exception propagated by the call of S'Put_Image is propagated.]
[Editor's note: There is no attempt to have such wording for the default implementations of the stream-oriented attributes, so we make no attempt to do that here, either. All such wording is redundant, since it follows directly from the definition of exception propagation in 11.4.]
!discussion
(1) The first paragraph is modeled on that found in 13.13.2(51/3) fo
stream-oriented attributes. The second paragraph is modeled on
!corrigendum 4.10(0)
Insert new clause:
See the conflict file for the changes.
!ASIS
No ASIS effect.
!ACATS test
No ACATS Tests needed.
!appendix

From the WG 9 review, issue #2.

Stream attributes define the subtype of the parameter of the associated
subprograms with 13.13.2(51/3). We don't have any similar rule for Put_Image
in 4.10. The definition of Put_Image seems to suggest that the parameter is
of type T, but types do not have names in Ada -- one always has to specify a
subtype.

Tucker also notes that we don't mention that the implicit calls of Put_Image
propagate any exceptions (including those caused by a subtype check
failure); we doubt anyone would expect anything else, but it usually is
explicitly mentioned in the RM.

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

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

Questions? Ask the ACAA Technical Agent