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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,3b3dfe072ce73a8a,start X-Google-Attributes: gid103376,public From: radke@cpre1.ee.iastate.edu (Kevin Radke) Subject: Is this legal Ada95? Date: 1997/11/06 Message-ID: <63t88t$mqk$1@news.iastate.edu>#1/1 X-Deja-AN: 287484649 Organization: Iowa State University, Ames, IA USA Newsgroups: comp.lang.ada Date: 1997-11-06T00:00:00+00:00 List-Id: I was compiling some Ada83 code originally written under VMS and the Dec Ada compiler, and Gnat v3.10p on NT gives me the following error: foo.adb:11:56: object "Initial_Value" cannot be used before end of its declaration This code has compiled successfully on 3 Ada83 compilers and 1 Ada95 compiler without problems. (This doesn't mean it is correct, just no one else has complained about it.) I was wondering if it is invalid somehow in Ada95 and the other Ada95 compiler missed it, or if GNAT is being finicky. Thanks! Kevin Here are the 3 files: -- begin double_buffer.ads -- package Double_Buffer is generic type Item_Type is private; Initial_Value : in Item_Type; package Interface is procedure Put(Item : in Item_Type); procedure Get(Item : out Item_Type); end Interface; end Double_Buffer; -- end double_buffer.ads -- -- begin foo.ads -- generic type Item_Type is private; Initial_Value : in Item_Type; package Foo is type Time_Tag_Type is new Integer; Null_Time_Tag : constant Time_Tag_Type := 0; procedure Bar (Item : in Item_Type); end Foo; -- end foo.ads -- -- begin foo.adb -- with Double_Buffer; package body Foo is type Tagged_Item_Type is record Item : Item_Type; Time_Tag : Time_Tag_Type; end record; package My_Buffer is new Double_Buffer.Interface (Tagged_Item_Type, Initial_Value => (Item => Initial_Value, Time_Tag => Null_Time_Tag)); procedure Bar (Item : in Item_Type) is begin null; end Bar; end Foo; -- end foo.adb --