Version 1.1 of acs/ac-00020.txt

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

!standard 8.2(02)          01-12-05 AC95-00020/01
!class confirmation 01-12-05
!status received no action 01-12-05
!subject Instantiating a generic with the same name

!topic instantiating generic with same name
!reference RM95-8.2(2)
!from Dan Eilers 01-12-05
!keywords visibility scope generic instantiation

procedure foo;

procedure foo is
end foo;

with foo;
package p is
   procedure FOO is new foo;  -- legal?

Is it legal to instantiate a generic foo with the same name, FOO?
My reading of 8.2(2) is that this is legal, because FOO is overloadable,
so its scope starts at the end of its specification, which would be after
the instantiation.  But my reading may be wrong, since GNAT rejects it.


From: Tucker Taft
Sent: Wednesday, December 5, 2001  5:02 PM

This looks like a GNAT bug (at least in the version you tested).
The RM allows this instantiation.  This is an explicit change from
Ada 83, as is explained in AARM 8.2(12.b), where the instantiation would
be illegal.


Questions? Ask the ACAA Technical Agent