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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,ee82e0a06c8bbead X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.74.201 with SMTP id w9mr1525956pbv.0.1333802928900; Sat, 07 Apr 2012 05:48:48 -0700 (PDT) Path: r9ni28983pbh.0!nntp.google.com!news2.google.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: sbelmont700@gmail.com Newsgroups: comp.lang.ada Subject: Re: A Gnother Gnasty bug Date: Sat, 7 Apr 2012 05:48:48 -0700 (PDT) Organization: http://groups.google.com Message-ID: <15240998.2014.1333802928507.JavaMail.geo-discussion-forums@vbsf4> References: <22193583.1528.1333759470339.JavaMail.geo-discussion-forums@vbdn7> <87mx6nvlwo.fsf@ludovic-brenta.org> NNTP-Posting-Host: 206.53.78.59 Mime-Version: 1.0 X-Trace: posting.google.com 1333802928 7079 127.0.0.1 (7 Apr 2012 12:48:48 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sat, 7 Apr 2012 12:48:48 +0000 (UTC) In-Reply-To: <87mx6nvlwo.fsf@ludovic-brenta.org> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=206.53.78.59; posting-account=ShYTIAoAAABytvcS76ZrG9GdaV-nXYKy User-Agent: G2/1.0 Content-Type: text/plain; charset=ISO-8859-1 Date: 2012-04-07T05:48:48-07:00 List-Id: Hi, I'm no language lawyer, but the same section from the LRM: > 3.3(23): [...] A class-wide subtype is defined to have unknown > discriminants, and is therefore an indefinite subtype. An indefinite > subtype does not by itself provide enough information to create an > object; an additional constraint or explicit initialization expression > is necessary (see *note 3.3.1). seems to imply that it is legal, given an initializer ("an ... explicit initialization expression is necessary"). Given > 4.8(4): An initialized allocator is an allocator with a > qualified_expression. [...] Then I would read it as being acceptable. After all, the fundamental problem is the same (how much room to make) whether you do it on the heap or the stack, and Ada has no problem with o : T'Class := Make_D; (Where an abstract T is extended by D), or any other indefinite types returned from functions (i.e. arrays, discriminated records). -sb