From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Path: eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: "Jeffrey R. Carter" Newsgroups: comp.lang.ada Subject: Re: Dueling Compilers Date: Fri, 27 Nov 2020 08:32:41 +0100 Organization: Also freenews.netfront.net; news.tornevall.net; news.eternal-september.org Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Fri, 27 Nov 2020 07:32:43 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="2a54ccd55513c211844646d3ae5b7131"; logging-data="17758"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/ybrf5TATCNgW0R2sxyDW5aJDbambhMzA=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 Cancel-Lock: sha1:7Yi88KmZ/m3pJAur2t65S/RF/6w= In-Reply-To: Content-Language: en-US Xref: reader02.eternal-september.org comp.lang.ada:60622 List-Id: On 11/26/20 3:19 AM, Randy Brukardt wrote: > > It's clear from 10.2.1 that a type with pragma PI which has components of a > generic formal type has to have components that have a type with PI. It > isn't possible to initialize such components without a function call, so the > other possibility does not exist. The Bounded containers are designed such > that there are components of the element type (more accurately, a component > of an array of the element type). In order for there to be such a component, > the formal type must have PI. Ergo, any body for a bounded container written > in Ada is necessarily illegal. This is a problem that someone should have > brought up at the ARG. I think both compilers are doing macro-expansion of generics, so a generic is only really compiled when it is instantiated. Presumably any test code used actual parameters that the compiler could tell were PI, so they compiled OK. > I don't know what the fix ought to be: adding PI to the formal private type > would work, but it would reduce the usabibility of the containers in > non-preelaborated contexts. Similarly, removing the PI from the container > would work, but would reduce the usability of the containers in > preelaborated contexts. Both seem pretty bad. I presumed that leaving PI on the container was an oversight. > So this will have to be an ARG question -- I can't answer it definitively. OK, I'll research the format of submissions to Ada-Comment and send it in. > P.S. If you post this question to Ada-Comment, do me a favor and post this > analysis along with it. That will save me having to reproduce it later. I would have done that anyway. Thanks for confirming my suspicion that something is rotten in Denmark. -- Jeff Carter "Many times we're given rhymes that are quite unsingable." Monty Python and the Holy Grail 57