Version 1.1 of ais/ai-00107.txt

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

!standard 04.01.04 (12)          96-11-16 AI95-00107/05
!class confirmation 96-04-04
!status WG9 approved 96-12-07
!status ARG approved 12-0-0 96-10-07
!status work item (letter ballot requested and failed) 96-09-15
!status ARG approved 8-0-0 (subject to editorial review) 96-06-17
!status work item 96-05-03
!status received 96-04-04
!reference AI-00093
!priority High
!difficulty Hard
!subject Base attribute for non-scalar subtypes?
!summary 96-04-04
An implementation must not allow the Base attribute for non-scalar subtypes.
!question 96-04-04
In Ada 83, the Base attribute is allowed for any type or subtype. In Ada 95, it is allowed only for scalar subtypes. May an implementation support the Base attribute for composite subtypes for the sake of upward compatibility? (No.)
!response 96-09-15
AI-93 allows an implementation to support the Small attribute for floating point types. One might consider allowing the Base attribute for composite or access subtypes for the same reason.
However, the upward compatibility argument in the case of Base is much weaker, since there really wasn't much that one could do with 'Base on a composite type, in Ada 83. One could do T'Base'Size, but changes to the Size attribute make this not quite upward compatible in any case.
Allowing the Base attribute on composite types in the same unrestricted way as for scalar types would cause semantic difficulties. For example, consider "X: T'Base;", where T is a generic formal private type. This would constitute a violation of the generic contract model, since it is not known at compile time of the generic body whether T'Base is definite or indefinite; thus, it is not known whether the object declaration is legal.
One could imagine allowing T'Base on composite types, but with the same restriction as in Ada 83 -- namely, that it can be used only as the prefix of another attribute_reference (and perhaps only for those attributes allowed in Ada 83, thus preventing T'Base'Class, for example). However, this adds complexity to the language, with little benefit.
!appendix

!section 4.1.4(12)
!subject Base attribute for composite subtypes?
!reference RM95-4.1.4(12)
!reference AARM95-3.5(63.h)
!reference AARM95-J(1.h)
!reference AI95-00093
!from Keith Thompson 95-10-30
!reference 95-5372.a Keith Thompson 95-10-30>>
!discussion

In Ada 83, the Base attribute is allowed for any type or subtype.
In Ada 95, it is allowed only for scalar subtypes.  May an implementation
support the Base attribute for composite subtypes for the sake of upward
compatibility?

This is similar to the question of supporting Float_Type'Small.

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

Questions? Ask the ACAA Technical Agent