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 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Potential Coextension Bug in GNAT Date: Thu, 20 Dec 2018 16:56:11 +0000 Organization: A noiseless patient Spider Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: reader01.eternal-september.org; posting-host="631a6c6f0697ed88e2921e868fe3a3bd"; logging-data="16358"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Twyxa0uOTCzzsscicCKRuylFqOBHezcU=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (darwin) Cancel-Lock: sha1:QdReM42YNeKLScqoDdZ1/3vEVWs= sha1:Jjr/99RymLsLa4iAA1LoI/6uq8s= Xref: reader01.eternal-september.org comp.lang.ada:55086 Date: 2018-12-20T16:56:11+00:00 List-Id: 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!