Version 1.1 of acs/ac-00054.txt

Unformatted version of acs/ac-00054.txt version 1.1
Other versions for file acs/ac-00054.txt

!standard 13.14(01)          03-06-23 AC95-00054/01
!class confirmation 03-06-23
!status received no action 03-06-23
!subject Address clauses and the linear elaboration model

From: Pascal Leroy
Sent: Thursday, April 24, 2003  10:43 AM

AARM 13.14(1.c) explains that the rules of the language (in particular
the freezing rules) are designed to support the linear elaboration
model.  However, it would seem that address clauses violate this model
(any representation item containing nonstatic expressions would
presumably have the same problem, but address clauses are the only ones
that are defined by the language).


    A : Integer;
    B : Integer;
    for A'Address use B'Address;

When A is elaborated B has not been elaborated yet, and the attribute
definition clause has not been elaborated either, so it is unclear how
the implementation is going to select the address of A.

The freezing rules don't help here: surely the attribute definition
clause freezes B, but we are not going to delay the elaboration of A
until B has been frozen (that would totally change the elaboration

I am not sure how this should be fixed in language terms.  In essence
the address expression for A should not reference anything occurring
between the declaration of A and the address clause.  But defining the
word "reference" here seems a bit delicate, among other things because
the address expression could conceivably do implicit calls to Finalize,
Allocate, etc.


From: Tucker Taft
Sent: Thursday, April 24, 2003  11:55 AM

I thought 13.1(22) handled this, by allowing implementations
to reject rep items for an entity containing nonstatic expressions
unless the nonstatic expression is dependent only on constants
declared prior to the entity.

Hence, an implementation taking full advantage
of this advice would require:

     B : Integer;
     B_Addr : constant System.Address := B'Address;
     A : Integer;
     for A'Address use B_Addr;


From: Pascal Leroy
Sent: Friday, April 25, 2003  3:37 AM

Agreed.  I had missed that paragraph.


Questions? Ask the ACAA Technical Agent