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=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.107.6.29 with SMTP id 29mr13668332iog.7.1508892804856; Tue, 24 Oct 2017 17:53:24 -0700 (PDT) X-Received: by 10.157.0.7 with SMTP id 7mr19468ota.14.1508892804826; Tue, 24 Oct 2017 17:53:24 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.mb-net.net!open-news-network.org!weretis.net!feeder6.news.weretis.net!feeder.usenetexpress.com!feeder-in1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!l196no5206903itl.0!news-out.google.com!193ni643iti.0!nntp.google.com!l196no5206900itl.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Tue, 24 Oct 2017 17:53:24 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=151.21.234.178; posting-account=fEeJQAoAAABLcKAvkveW1ca-ReZJoaMK NNTP-Posting-Host: 151.21.234.178 References: <2be64a8b-5f89-414c-9dcd-433bd5d855a0@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <97915524-04a8-4954-8ed8-058ad63f529e@googlegroups.com> Subject: Re: Alleged GNAT bug From: "A. Cervetti" Injection-Date: Wed, 25 Oct 2017 00:53:24 +0000 Content-Type: text/plain; charset="UTF-8" Xref: news.eternal-september.org comp.lang.ada:48582 Date: 2017-10-24T17:53:24-07:00 List-Id: I apologize. I reworked the code in a single program: --------------------------------------------------------------------------- with Ada.Finalization; procedure My_Test is generic package Handled_Record is type Base_Object is new Ada.Finalization.Controlled with null record; not overriding procedure Finalize_Handle(Object: Base_Object) is null; generic type Base is new Base_Object with private; package With_Finalization is type Derived is new Base with null record; end; end Handled_Record; package Term is package Term_Handled_Record is new Handled_Record; type Term_Type_Without_Finalize is new Term_Handled_Record.Base_Object with null record; overriding procedure Finalize_Handle (Object: Term_Type_Without_Finalize); type Term_Kind is (Literal); type Term_Literal_Value is private; not overriding function Get_Literal (Term: Term_Type_Without_Finalize) return Term_Literal_Value; package Finalizer is new Term_Handled_Record.With_Finalization(Term_Type_Without_Finalize); type Term_Type is new Finalizer.Derived with null record; private type Term_Literal_Value is null record; end Term; package body Term is function Get_Literal (Term: Term_Type_Without_Finalize) return Term_Literal_Value is begin return (null record); end; procedure Finalize_Handle (Object: Term_Type_Without_Finalize) is begin null; end; end Term; begin null; end My_Test; -------------------------------------------------------------------------- Compiling with gnat 4.9.3 crashes the compiler (Storage_Error stack overflow or erroneous memory access at my_test.adb:3:1) Compiling with gnat-2017 from libre.adacore.com the compilation goes well (obviously it does nothing). The original code is split in three modules (handled_record.ads, term.ads, term.adb). With both compilers it give the error: system.ads:1:01: declaration must appear after completion of type "Term_Literal_Value" gnatmake: "term.adb" compilation error Removing the lines: type Derived is new Base with null record; and type Term_Type is new Finalizer.Derived with null record; from my_test.adb and from the original modules the compilation goes well. Also with the modification I suggested in my first post the compilation goes well in both versions. So I conclude: The error happens at the freezing point, but with gnat-2017 only in the modular version. The code could be legal because it works in the monolithic version, but after reading Randy's message I am no more sure of anything. > Too sick to take on extra work... Sorry to hear this, I hope you will be well soon. A.