Version 1.2 of acs/ac-00162.txt

Unformatted version of acs/ac-00162.txt version 1.2
Other versions for file acs/ac-00162.txt

!standard 3.8(13)          08-05-10 AC95-00162/01
!class confirmation 08-05-10
!status received no action 08-05-10
!status received 08-03-18
!subject Clarification of 3.8(13)

!topic Clarification of 3.8(13)
!reference 3.8(13)
!from Adam Beneschan 08-03-18

3.8(13) says:

    If the name of the current instance of a type (see 8.6) is used to
    define the constraint of a component, then it shall appear as a
    direct_name that is the prefix of an attribute_reference whose
    result is of an access type, and the attribute_reference shall
    appear alone.

I'm a little unclear on precisely what "If the name of the current
used to define" means.  Does this mean *any* use of the name including as the
prefix of a selected component?

Specifically, is this legal or not?

    type T (N : integer) is record
        S : String (1 .. T.N);
    end record;

Obviously it would be legal if the constraint were 1..N; and T.N, with T
referring to the current instance of a type, would mean the same thing as N
here; so there isn't any reason why *this* particular construct should be
disallowed (unlike the example given in AARM 3.8(13.a)), except of course to
keep the rule simple.  But since the phrase "is used to define" is a little bit
fuzzy, I wanted to make sure I'm interpreting it correctly.


From: Tucker Taft
Date: Tuesday, March 18, 2008  8:40 PM

"... is used to define the constraint..." means that the name appears within a

This is intentionally very similar to the wording in 3.8(12):

   If the discriminant is used to define the
   constraint of a component, the bounds of an
   entry family, or the constraint of the parent
   subtype in a derived_type_definition then its
   name shall appear alone as a direct_name (not
   as part of a larger expression or expanded name).

Both of these paragraphs have been untouched since Ada 95.  I suspect 3.8(12)
came from Ada 83.


Questions? Ask the ACAA Technical Agent