#247571 Wrong output from legal program, pragma Import (Ada)

Package:
gnat-12
Source:
gcc-12
Description:
GNU Ada compiler
Submitter:
Date:
2022-04-04 05:33:18 UTC
Severity:
normal
Tags:
#247571#5
Date:
2004-05-05 20:17:55 UTC
From:
To:
package pak is
   procedure p1;
   procedure p1(x: integer);
   pragma export(ada, p1);
end pak;

with text_io; use text_io;
package body pak is
   procedure p1 is
   begin
      put_line("passed");
   end;

   procedure p1(x: integer) is
   begin
      put_line("failed: wrong p1 called");
   end;
end pak;

with pak;
procedure Test_77 is
   procedure p1;
   pragma import(ada, p1);
begin
   p1;
end Test_77;



The program outputs:
failed: wrong p1 called


The procedure that was exported is reimported; this is the wrong one!

#247571#22
Date:
2008-12-30 20:32:43 UTC
From:
To:
found 247020 4.3.2-2
found 247569 4.3.2-2
found 247571 4.3.2-2
thanks

#247571#33
Date:
2009-08-06 14:49:49 UTC
From:
To:
found 247571 4.4.1-1
thanks