[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#427108: gnat-4.1: Legal program executes incorrectly, RM 3.4(27)



Package: gnat-4.1
Version: 4.1.1-22
Severity: normal

The following program prints FAILED; it should print PASSED
as per RM 3.4(27), which states:

-- "For the execution of a call on an inherited subprogram,
-- a call on the corresponding primitive subprogram of the
-- parent or progenitor type is performed; the normal conversion
-- of each actual parameter to the subtype of the corresponding
-- formal parameter (see 6.4.1) performs any necessary type
-- conversion as well."

with Text_IO; use Text_IO;
procedure Test1 is
   package Pak1 is
      type T1 is tagged null record;
      function Eq(X, Y: T1) return Boolean renames "=";
   end Pak1;

   package Pak2 is
      type T2 is new Pak1.T1 with record
         F1: Integer;
      end record;
   end Pak2;

   Z1: Pak2.T2 := (F1 => 1);
   Z2: Pak2.T2 := (F1 => 2);
begin
   if Pak2.Eq(Z1, Z2) = Pak1.Eq(Pak1.T1(Z1), Pak1.T1(Z2))
      then Put_Line("PASSED");
      else Put_Line("FAILED");
   end if;
end Test1;

-- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.18-3-amd64 (SMP w/2 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages gnat-4.1 depends on:
ii  gcc-4.1                     4.1.1-21     The GNU C compiler
ii  gnat-4.1-base               4.1.1-22     The GNU Compiler Collection
(gnat 
ii  libc6                       2.3.6.ds1-13 GNU C Library: Shared
libraries
ii  libc6-dev                   2.3.6.ds1-13 GNU C Library: Development
Librari
ii  libgcc1                     1:4.1.1-21   GCC support library
ii  libgnat-4.1                 4.1.1-22     Runtime library for GNU Ada
applic
ii  libgnatprj4.1               4.1.1-22     GNU Ada Project Manager
ii  libgnatvsn4.1               4.1.1-22     GNU Ada compiler version
library

gnat-4.1 recommends no packages.

-- no debconf information




Reply to: