comp.lang.ada
 help / color / mirror / Atom feed
* Dueling Compilers
@ 2020-11-25 14:08 Jeffrey R. Carter
  2020-11-26  2:19 ` Randy Brukardt
  2020-12-02 15:41 ` Shark8
  0 siblings, 2 replies; 8+ messages in thread
From: Jeffrey R. Carter @ 2020-11-25 14:08 UTC (permalink / raw)


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

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-12-19  2:00 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-25 14:08 Dueling Compilers Jeffrey R. Carter
2020-11-26  2:19 ` Randy Brukardt
2020-11-27  7:32   ` Jeffrey R. Carter
2020-11-28  2:35     ` Randy Brukardt
2020-12-17 20:22       ` Jeffrey R. Carter
2020-12-19  2:00         ` Randy Brukardt
2020-12-02 15:41 ` Shark8
2020-12-02 16:08   ` AdaMagica

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox