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=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,7d1beb081a67a9b,start X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!weretis.net!feeder4.news.weretis.net!nuzba.szn.dk!pnx.dk!news.buerger.net!LF.net!news.enyo.de!not-for-mail From: Florian Weimer Newsgroups: comp.lang.ada Subject: Life-time of temporaries Date: Sat, 30 Oct 2010 14:03:00 +0200 Message-ID: <87fwvn51mz.fsf@mid.deneb.enyo.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: idssi.enyo.de 1288440180 10163 172.17.135.6 (30 Oct 2010 12:03:00 GMT) X-Complaints-To: news@enyo.de Cancel-Lock: sha1:LZNzInzogiA5U0FkdToZ5cPN5AE= Xref: g2news2.google.com comp.lang.ada:15936 Date: 2010-10-30T14:03:00+02:00 List-Id: Does the following program result in erroneous execution? with Ada.Text_IO; with System.Storage_Elements; procedure T is type Ref is record Address : System.Address; Length : System.Storage_Elements.Storage_Count; end record; function "+" (S : String) return Ref is begin return Ref'(S'Address, S'Length); end "+"; procedure Print (R : Ref) is subtype String_Type is String (1 .. Integer (R.Length)); S : String_Type; pragma Import (Ada, S); for S'Address use R.Address; begin Ada.Text_IO.Put_Line (S); end Print; begin Print (+Integer'Image(17)); end T; It seems to me it doesn't, thanks to the clarification in AI95-162, although it does not seem to be the main direction of that change.