Version 1.1 of acs/ac-00134.txt

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

!standard 3.10.2(2.2/2)          06-11-06 AC95-00134/01
!class confirmation 06-11-06
!status received no action 06-11-06
!status received 06-07-26
!subject Conformance rule for access-to-subprogram reference
!summary
!appendix

!topic Access
!reference Ada 2005 RM 3.10.2
!from Christoph Grein 06-07-26
!keywords access
!discussion

RM 3.10.2(2.2/2) only requests type conformance for an attribute reference with
'Access. Shouldn't this be mode conformance?

type Ref is access procedure (X: in Integer);

procedure P (X: out Integer);

R: Ref := P'Access;  -- legal?

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

From: Adam Beneschan
Date: Wednesday, July 26, 2006 10:54 AM

No.  3.10.2(32/2) says it has to be subtype-conformant, which implies
mode conformance.  The problem is you're looking at a Name Resolution
rule, not a legality rule.  So 3.10.2(2.2/2) simply means that
parameter modes aren't used for overload resolution---not that the
modes don't have to match.  (Thus, if two procedures P were visible,
one with a parameter (X: out Integer), and one with a parameter (X: in
Integer), P'Access would be rejected as ambiguous.  The compiler
wouldn't automatically pick the one with the "in" parameter.)

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


Questions? Ask the ACAA Technical Agent