This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug ada/15609] New: Legal program rejected, generic formal parameter conflicts with declaration


with text_io;
procedure Test_244941 is
   function f1 return integer is begin return 1; end f1;
   function f2 return integer is begin return 2; end f2;

   generic
      with function foo return integer;
   package pak1 is
      function foo return integer renames f2;
   end pak1;

   package new_pak1 is new pak1(f1);
begin
   if new_pak1.foo = 2
      then text_io.put_line("passed");
      else text_io.put_line("failed");
   end if;
end Test_244941;


test_244941.adb:9:16: "foo" conflicts with declaration at line 7
test_244941.adb:9:35: duplicate body for "foo" declared at line 7
test_244941.adb:14:15: ambiguous expression (cannot resolve "Foo")
test_244941.adb:14:15: possible interpretation at line 9, instance at line 12
test_244941.adb:14:15: possible interpretation at line 12
gnatmake: "test_244941.adb" compilation error

-- 
           Summary: Legal program rejected, generic formal parameter
                    conflicts with declaration
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: ada
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: ludovic dot brenta at insalien dot org
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]