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!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "Michael B." Newsgroups: comp.lang.ada Subject: Accessibility and possible Gnat bug Date: Fri, 19 Dec 2014 16:35:38 +0100 Organization: Aioe.org NNTP Server Message-ID: NNTP-Posting-Host: XJjAb+jUh9wiJnCvCOOceA.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.3.0 X-Notice: Filtered by postfilter v. 0.8.2 Xref: news.eternal-september.org comp.lang.ada:24150 Date: 2014-12-19T16:35:38+01:00 List-Id: In the previous discussion about accessibility I was pointed to the paper "Accessibility rules OK!" of John Barnes (ACM SIGAda Ada Letters Volume XV Issue 1, Jan./Feb. 1995) which contains the following example: procedure Example6 is type T is new Integer; procedure P1(XP1 : access T) is type A is access all T; Ptr: A := null; procedure P2(XP2: access T) is begin Ptr := A(XP2); end P2; begin P2(XP1); end P1; X : aliased T; begin declare Y : aliased T; begin declare Z : aliased T; begin P1(X'Access); P1(Y'Access); P1(Z'Access); -- Raises Program_Error. end; end; end Example6; In the paper the program is expected to run without errors. I compiled it with Gnat 4.9 on Debian 8.0, ran it and got an Program_Error on the marked line. Is this correct in Ada 2012 or not? I would like to hear your opinion about that before I write a possibly unnecessary bug report to AdaCore. Regards, Michael