Debian bug #278687:

-- The second parameter of T2'Class'Read is of type T2'Class,
-- which should match an object of type T3, which is derived
-- from T2.
package test_127 is
   pragma elaborate_body;
end test_127;

with ada.streams;
package body test_127 is
   type T1 is access all ada.streams.root_stream_type'class;
   type T2 is tagged null record;
   type T3 is new T2 with null record;

   x: T1;
   y: T3;
begin
   T2'class'read(x, y);
end test_127;


The program is legal but the output of gnat is:

test_127.adb:11:21: expected type "T2" defined at line 5
test_127.adb:11:21: found type "T3" defined at line 6
gnatmake: "test_127.adb" compilation error

-- 
           Summary: Legal program rejected, RM 13.13.2(14)
           Product: gcc
           Version: 3.4.2
            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


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

Reply via email to