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/15615] New: Legal program rejected, derived tagged type in child package doesn't see parent's element


package pak1 is
   type T1 is tagged private;
private
   type T1 is tagged record
      i1: integer;
   end record;
end pak1;

generic
   type T2 is new T1 with private;
package pak1.pak2 is
private
   x1 : T2;
   i2: integer := x1.i1;
end pak1.pak2;

with pak1.pak2;
package Test_246183 is
   type T3 is new pak1.T1 with null record;
   package new_pak2 is new pak1.pak2(T3);
end Test_246183;

The compiler incorrectly says:
test_246183.ads:5:04: instantiation error at pak1-pak2.ads:7
test_246183.ads:5:04: no selector "i1" for type "T3" defined at line 4
gnatmake: "test_246183.ads" compilation error

-- 
           Summary: Legal program rejected, derived tagged type in child
                    package doesn't see parent's element
           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=15615


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