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.198.65 with SMTP id w62mr1199524iof.105.1519178406239; Tue, 20 Feb 2018 18:00:06 -0800 (PST) X-Received: by 10.157.68.9 with SMTP id u9mr73996ote.5.1519178406096; Tue, 20 Feb 2018 18:00:06 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!border1.nntp.ams1.giganews.com!nntp.giganews.com!peer01.ams1!peer.ams1.xlned.com!news.xlned.com!peer01.am4!peer.am4.highwinds-media.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!o66no57124ita.0!news-out.google.com!10ni158ite.0!nntp.google.com!w142no58262ita.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Tue, 20 Feb 2018 18:00:05 -0800 (PST) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=137.103.119.68; posting-account=ShYTIAoAAABytvcS76ZrG9GdaV-nXYKy NNTP-Posting-Host: 137.103.119.68 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <74cfbf22-7082-4a43-aef9-6a55a049fe61@googlegroups.com> Subject: Default_Storage_Pool From: sbelmont700@gmail.com Injection-Date: Wed, 21 Feb 2018 02:00:06 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Received-Body-CRC: 1998990037 X-Received-Bytes: 2337 Xref: reader02.eternal-september.org comp.lang.ada:50514 Date: 2018-02-20T18:00:05-08:00 List-Id: Can anyone offer insight into what exactly should happen when Default_Stora= ge_Pool is explicitly set within an extended return statement to a pool wit= hin the return object? In particular, consider these shenanigans: package O is pool_1 : My_Fancy_Pool pragma Default_Storage_Pool(pool_1); =20 type T is limited record pool_2 : My_Fancy_Pool p1 : access Integer; end record; =20 function F return T; =20 end O; package body O is function F return T is begin return Result : T do declare pragma Default_Storage_Pool(Result.pool_2); -- legal? p2 : access Integer; begin p2 :=3D new integer'(42); Result.p1 :=3D new integer'(43); end; end return; end F; =20 end O; =20 GNAT happily accepts this, but based on print lines, it allocates Result.p1= from pool_1 and p2 from some unspecified default pool (i.e. neither pool_1= or pool_2). I wasn't sure what I was expecting; I assumed an error messag= e, but failing that, both to go into result.pool_2, and was surprised to ge= t neither. Any clarifications are appreciated. -sb