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

In the program below, the full declaration of T2 (in the private part
of the package) is illegal because it conflicts with the public
declaration.  The public declaration defines the discriminant, d1, to
have the value 3 whereas the private declaration specifies the value
to be 4.

GNAT fails to diagnose this error.

-- error not detected
package pak1 is
   -- RM 7.3(13), 4.9.1(1)
   -- check that discriminants statically match
   type T1(d1: integer) is tagged null record;
   type T2 is new T1 (3) with private;
private
   subtype T3 is T1 (4);
   type T2 is new T3 with null record;  -- Error: 3 vs 4
end pak1;

To reproduce:

gnatmake pak1.ads

Error message expected:
pak1.ads:9:8: full view of type "T2" conflicts with public declaration at line 6

-- System Information:
Debian Release: 4.0
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.18-3-amd64
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)

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



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to