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 2002:a24:24e:: with SMTP id 75mr1796381itu.0.1545391483745; Fri, 21 Dec 2018 03:24:43 -0800 (PST) X-Received: by 2002:a9d:6f14:: with SMTP id n20mr39043otq.2.1545391483662; Fri, 21 Dec 2018 03:24:43 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!news.uzoreto.com!2.eu.feeder.erje.net!4.us.feeder.erje.net!feeder.erje.net!weretis.net!feeder6.news.weretis.net!feeder.usenetexpress.com!feeder-in1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!k10no35217itk.0!news-out.google.com!v141ni73ita.0!nntp.google.com!k10no35212itk.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Fri, 21 Dec 2018 03:24:43 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=98.118.241.43; posting-account=QF6XPQoAAABce2NyPxxDAaKdAkN6RgAf NNTP-Posting-Host: 98.118.241.43 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Potential Coextension Bug in GNAT From: Jere Injection-Date: Fri, 21 Dec 2018 11:24:43 +0000 Content-Type: text/plain; charset="UTF-8" Xref: reader01.eternal-september.org comp.lang.ada:55096 Date: 2018-12-21T03:24:43-08:00 List-Id: On Thursday, December 20, 2018 at 11:56:13 AM UTC-5, Simon Wright wrote: > Jere writes: > > > I was messing around and trying to learn coextensions and > > I came across some counter intuitive functionality. If I > > directly initialize one via an aggregate, it works fine. > > However, if I initialize through a constructing function, > > it seems to treat the access discriminant as a normal access > > type and finalizes it at the end of the program instead of > > when the object leaves scope. > > Compiling with -gnatwa I see "warning: coextension will not be finalized > when its associated owner is deallocated or finalized", so GNAT clearly > meant to do it! that's pretty interesting. The compiler I was using did not give that warning when compiled with -gnatwa. You're right, that definitely looks intentional.