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=-0.9 required=3.0 tests=AC_FROM_MANY_DOTS,BAYES_00 autolearn=no 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: Dueling Compilers Date: Wed, 25 Nov 2020 15:08:40 +0100 Organization: Also freenews.netfront.net; news.tornevall.net; news.eternal-september.org Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Wed, 25 Nov 2020 14:08:41 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="878f620473ef13642264c6b2bd64a62d"; logging-data="3725"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+xCnY8pXpazeRZwAHfMm2bnbgDAUJibz8=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.3.2 Cancel-Lock: sha1:4OAQKcRVdlM/QtjHMhU/yP9I+zc= Content-Language: en-US X-Mozilla-News-Host: snews://news.eternal-september.org:563 Xref: reader02.eternal-september.org comp.lang.ada:60615 List-Id: Consider the package with Ada.Containers.Bounded_Doubly_Linked_Lists; generic type E is private; package Preelaborable is package EL is new Ada.Containers.Bounded_Doubly_Linked_Lists (Element_Type => E); end Preelaborable; Two Ada-12 compilers give different results on this. Compiler G accepts it without problem. Compiler O rejects it with the error message preelaborable.ads: Error: line 6 col82 LRM:10.2.1(11.8/2), If a pragma Preelaborable_Initialization has been applied to the generic formal, the corresponding actual type must have preelaborable initialization AFAICT from the ARM, the generic formal Element_Type of Ada.Containers.Bounded_Doubly_Linked_Lists does not have pragma Preelaborable_Initialization applied to it. However, the type List, which probably has [sub]components of Element_Type, does. Which compiler is correct? What is the intent of the ARM? -- Jeff Carter "Apart from the sanitation, the medicine, education, wine, public order, irrigation, roads, the fresh water system, and public health, what have the Romans ever done for us?" Monty Python's Life of Brian 80