(Debian bug #284332)

-- RM 4.7(3):  The operand [of a qualified expression] shall resolve
-- to be of the type determined by the subtype_mark...
-- see AI-332 (not yet approved).

procedure Test_134 is

   type T1 is tagged null record;

   procedure p3 (x1: T1) is
   begin
      null;
   end;

   x2: T1'class := T1'(null record);
   x3: T1'class := T1'(x2);     -- ERROR: T1 not same type as T1'class
begin
   p3(x1 => T1'(x2));           -- ERROR: T1 not same type as T1'class
end Test_134;


The expected output from gnat is:

test_134.adb:15:23: expected type "T1"
test_134.adb:15:23: found type "T1'Class"
test_134.adb:17:16: expected type "T1"
test_134.adb:17:16: found type "T1'Class"
gnatmake: "test_134.adb" compilation error


Instead, the compiler is silent.

-- 
           Summary: Illegal program not detected, RM 4.7(3)
           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=18845

Reply via email to