From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC,T_FILL_THIS_FORM_SHORT autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,7001494ace46eea7,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-09-18 07:24:58 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!newsmi-us.news.garr.it!NewsITBone-GARR!area.cu.mi.it!newsfeeder.edisontel.com!fu-berlin.de!uni-berlin.de!b8a69.pppool.DE!not-for-mail From: Dmitry A.Kazakov Newsgroups: comp.lang.ada Subject: Overriding discriminants perplexes GNAT 3.14p Date: Thu, 19 Sep 2002 04:32:18 +0200 Message-ID: Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: b8a69.pppool.de (213.7.138.105) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Trace: fu-berlin.de 1032359095 4198974 213.7.138.105 (16 [77047]) User-Agent: KNode/0.4 Xref: archiver1.google.com comp.lang.ada:29110 Date: 2002-09-19T04:32:18+02:00 List-Id: Hi! The following primitive code causes "GNAT bug detected" report: -------- with Ada.Finalization; use Ada.Finalization; package Test1 is type X (N : Natural) is new Ada.Finalization.Limited_Controlled with private; procedure Initialize (Obj : in out X); private type X (N : Natural) is new Ada.Finalization.Limited_Controlled with record NS : String (1..N); end record; end Test1; ---------- package body Test1 is procedure Initialize (Obj : in out X) is begin null; end Initialize; end Test1; ---------- package Test1.Test2 is type XX (M : Natural; N : Natural) is new X with private; procedure Initialize (Obj : in out XX); private type XX (M : Natural; N : Natural) is new X (N) with record MS : String (1..M); end record; end Test1.Test2; ---------- package body Test1.Test2 is procedure Initialize (Obj : in out XX) is begin Initialize (X (Obj)); end Initialize; end Test1.Test2; ---------- package Test1.Test2.Test3 is type XXX is new XX (10, 20) with private; procedure Initialize (Obj : in out XXX); private type XXX is new XX (10, 20) with null record; end Test1.Test2.Test3; ---------- package body Test1.Test2.Test3 is procedure Initialize (Obj : in out XXX) is begin Initialize (XX (Obj)); end Initialize; end Test1.Test2.Test3; ---------- 1. Unconstrained type X has a discriminant 2. Unconstrained XX (derived from X) has two disriminants. It overrides the discriminant of X 3. Constrained XXX is derived from XX. This results in a bug report (crash) under Windows. What wonders me is which sort of validation uses ACT if such bugs go through? People rightly criticize MS VC++, but the situation with Ada compilers isn't much better. I judge from my experience with GNAT and Object Ada. It is a permanent battle of finding work-arounds for countless compiler bugs. Is there any good Ada compilers since DEC gone? -- Regards, Dmitry Kazakov www.dmitry-kazakov.de