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!reader02.eternal-september.org!feeder.eternal-september.org!nntp-feed.chiark.greenend.org.uk!ewrotcd!newsfeed.xs3.de!io.xs3.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED.rrsoftware.com!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Formal Subprogram Access Date: Mon, 12 Feb 2018 23:51:53 -0600 Organization: JSA Research & Innovation Message-ID: References: Injection-Date: Tue, 13 Feb 2018 05:51:54 -0000 (UTC) Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226"; logging-data="5579"; mail-complaints-to="news@jacob-sparre.dk" X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Response X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246 Xref: reader02.eternal-september.org comp.lang.ada:50409 Date: 2018-02-12T23:51:53-06:00 List-Id: "Jeffrey R. Carter" wrote in message news:p5mflm$ibq$1@dont-email.me... > On 02/10/2018 04:03 AM, Randy Brukardt wrote: >> >> Why do you think this is correct? I can't read 3.10.2(32/5) in a way >> which >> would prevent using a formal subprogram in this way (assuming that the >> profile matches, which is does trivially in this case). Indeed, there is >> specifically an exception allowing "an anonymous access type of an access >> parameter." > > IIRC, you can't take 'Access of some attributes that act as subprograms, > but you can use them as the actual for a generic formal subprogram. So a > generic can't take 'Access of a generic formal subprogram. There's no such rule in the RM. As Christoph noted, a generic formal subprogram has convention Ada, 'Access is allowed. If you pass an attribute to it, you have to wrap it in a real subprogram for this reason. (There is a lot of code specifically to do this in Janus/Ada, it probably never has been tested outside of a single ACATS test -- I don't think anyone ever has had a reason to pass an attribute like Succ as a formal subprogram.) If you rename such an attribute, however, the convention stays the same, so 'Access isn't allowed then. But renaaming a formal subprogram certainly shouldn't change whether or not 'Access is allowed. As I said, file a bug report. Even if I'm wrong about the legality of 'Access on a formal subprogram, the renames should work the same way. Randy.