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=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=unavailable autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,a80deac1fd7c71d4,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-03-16 06:09:57 PST Path: archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!crtntx1-snh1.gtei.net!chcgil2-snh1.gtei.net!news.bbnplanet.com!nycmny1-snf1.gtei.net!news.gtei.net!colt.net!news.tele.dk!news.tele.dk!small.news.tele.dk!proxad.net!freenix!enst.fr!melchior!cuivre.fr.eu.org!melchior.frmug.org!not-for-mail From: Lionel.DRAGHI@fr.thalesgroup.com Newsgroups: comp.lang.ada Subject: Another small discrepancy between compilers Date: Tue, 16 Mar 2004 15:05:52 +0100 Organization: Cuivre, Argent, Or Message-ID: NNTP-Posting-Host: lovelace.ada-france.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: melchior.cuivre.fr.eu.org 1079445988 48908 212.85.156.195 (16 Mar 2004 14:06:28 GMT) X-Complaints-To: usenet@melchior.cuivre.fr.eu.org NNTP-Posting-Date: Tue, 16 Mar 2004 14:06:28 +0000 (UTC) To: comp.lang.ada@ada-france.org Return-Path: X-Mailer: Internet Mail Service (5.5.2653.19) X-Virus-Scanned: by amavisd-new-20030616-p7 (Debian) at ada-france.org X-BeenThere: comp.lang.ada@ada-france.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Gateway to the comp.lang.ada Usenet newsgroup" List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Xref: archiver1.google.com comp.lang.ada:6345 Date: 2004-03-16T15:05:52+01:00 Here is another small difference between GNAT and ObjectAda. It's not important at all, I am just curious about wich one is right. GNAT seems to be wrong accepting to compile it, what do you think about it? TIA -- Lionel. with Ada.Text_IO; use Ada.Text_IO; with Ada.Tags; procedure Bug is type T_Event is abstract tagged null record; type T_New_Event is new T_Event with null record; function Get return T_Event'Class is Tmp : T_New_Event; begin return Tmp; end Get; Msg : constant T_Event'Class := Get; begin Put_Line (Ada.Tags.Expanded_Name (T_Event (Msg)'Tag)); -- 1 Put_Line (Ada.Tags.Expanded_Name (T_Event'Class (Msg)'Tag)); -- 2 Put_Line (Ada.Tags.Expanded_Name (Msg'Tag)); -- 3 -- 1 : OK for GNAT 3.16a (20030120) -- KO for ObjectAda (tm) Version 7.2.1 : -- *****Error: LRM:3.9(13) & 3.9(17) The prefix to 'TAG must be a tagged subtype -- ***** or an object or value of a classwide tagged type, Continuing -- 2 : OK for GNAT 3.16a (20030120) but with a warning -- "Useless conversion, "Msg" has this type" -- before the code simplification. -- OK for ObjectAda (tm) Version 7.2.1 -- 3 : what this code should always have been! compile with both. end Bug;