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,1c6d2cced6ff12bb,start X-Google-Attributes: gid103376,public From: tmoran@bix.com (Tom Moran) Subject: record rep on tagged record question Date: 1997/09/23 Message-ID: <3428278b.18967041@SantaClara01.news.InterNex.Net>#1/1 X-Deja-AN: 274944509 Organization: InterNex Information Services 1-800-595-3333 Newsgroups: comp.lang.ada Date: 1997-09-23T00:00:00+00:00 List-Id: Shouldn't this be legal Ada 95? One of the three compilers I tried gives a "raised CONSTRAINT_ERROR" when I try to execute it. The message apparently comes from the attempt to elaborate "Picture:b.Child_Type", since neither the Ada.Text_IO in the main program nor the one in its exception handler produces any result. (The other two compilers both give "hi" results.) I've checked and Tag'Size for this compiler is 32, so an offset of 4 bytes seems appropriate. If I set TAG_SIZE to zero, the compiler complains that I'm trying to overlay the tag. If I eliminate the 'for Root_Type use record' rep clause entirely, I get "hi". package b is TAG_SIZE : constant := 4; type Root_Type is tagged record I : Integer; end record; for Root_Type use record I at TAG_SIZE range 0 .. 31; end record; type Child_Type is new Root_Type with record J : Integer; end record; end b; with ada.exceptions; with ada.text_io; with b; procedure try is Picture : b.Child_Type; begin ada.text_io.put_line("hi"); exception when oops:others => ada.text_io.put_line("oops:" & ada.exceptions.exception_information(oops)); end try;