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: 103376,c9e3d58bccd981dd X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,CP1252 Path: g2news2.google.com!postnews.google.com!r18g2000yqd.googlegroups.com!not-for-mail From: Ludovic Brenta Newsgroups: comp.lang.ada Subject: Re: Defaults for formal subprogram Date: Wed, 28 Apr 2010 03:56:43 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <629d4f19-6d99-4c4e-bffa-2a2b287410eb@u34g2000yqu.googlegroups.com> <9ac3f3db-819c-4232-b580-30a67411dd70@c21g2000yqk.googlegroups.com> NNTP-Posting-Host: 153.98.68.197 Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1272452203 4725 127.0.0.1 (28 Apr 2010 10:56:43 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 28 Apr 2010 10:56:43 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: r18g2000yqd.googlegroups.com; posting-host=153.98.68.197; posting-account=pcLQNgkAAAD9TrXkhkIgiY6-MDtJjIlC User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3,gzip(gfe) Xref: g2news2.google.com comp.lang.ada:11225 Date: 2010-04-28T03:56:43-07:00 List-Id: On Apr 28, 12:53=A0pm, Ludovic Brenta wrote: > Christoph Grein wrote on comp.lang.ada: > > > > > > procedure Aaa is > > > > =A0 =A0type Proc_Ptr is access procedure; > > > > =A0 =A0X : Proc_Ptr; > > > > =A0 =A0generic > > > =A0 =A0 =A0 with procedure Bbb is X.all; > > > =A0 =A0 =A0 -- aaa.adb:8:31: expect valid subprogram name as default > > > =A0 =A0package Pkg is > > > =A0 =A0end Pkg; > > > AARM 12.6(5.b) The evaluation of the default_name takes place during > > the elaboration of each instantiation that uses the default, as > > defined in 12.3, =93Generic Instantiation=94. > > > So I don't see a problem. > > I think this violates 12.6(3/2) and 12.6(4): > > 3/2 subprogram_default ::=3D default_name | <> | null > 4 =A0 =A0default_name ::=3D name > > Here, you are trying to use an expression as opposed to a name. Ah but looking further I see 4.1(2): name ::=3D direct_name | explicit_dereference | indexed_component | slice | selected_component | attribute_reference | type_conversion | function_call | character_literal and 4.1(5): explicit_dereference ::=3D name.all so your code now seems legal to me. So this is probably a compiler bug. -- Ludovic Brenta.