[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#660698: gnat-4.6: Legal program rejected. Use in subpackage invalidates use type



Package: gnat-4.6
Version: 4.6.2-3
Severity: normal

I reported the problem to
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52319).

The following legal program is rejected by "gnatgcc -c proc.adb" with

proc.adb:17:28: there is no applicable operator "And" for type
"Standard.Integer"

All works fine if P2 is removed.

procedure Proc is
   package P1 is
      type T is new Integer;
      function "and" (L, R : in Integer) return T;
   end P1;
   package body P1 is
      function "and" (L, R : in Integer) return T is
         pragma Unreferenced (L, R);
      begin
         return 0;
      end "and";
   end P1;
   use type P1.T;
   package P2 is
      use P1;
   end P2;
   G : P1.T := Integer'(1) and Integer'(2);
begin
   null;
end Proc;



Reply to: