http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47748

           Summary: Legal program rejected, ARM 12.7(3/2): instantiating a
                    generic package with "others => <>"
           Product: gcc
           Version: 4.5.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ada
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: ludo...@ludovic-brenta.org


This bug was first reported on comp.lang.ada and confirmed:

package formalpkg is

   generic
      type T is private;
      with procedure P (X : T) is <>;
   package F is
   end F;

   generic
      with package FA is new F (others => <>); -- line 17
   package B is
   end B;

   procedure P1 (X : Character) is null;
   package F1 is new F (Character, P1); -- use P => P1

   package B1 is new B (F1); -- Error !!

   procedure P (X : Character) is null;
   package F2 is new F (Character); -- P => P

   package B2 is new B (F2); -- OK

end formalpkg;
--------
% gnatmake formalpkg.ads
gcc -c formalpkg.ads
formalpkg.ads:17:25: actual for "P" in actual instance does not match formal
gnatmake: "formalpkg.ads" compilation error 

On line 17, replacing "others => <>" with just "<>" makes the package compile
cleanly.

Reply via email to