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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,4ac21d90d2c73106,start X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!j19g2000yqk.googlegroups.com!not-for-mail From: Maciej Sobczak Newsgroups: comp.lang.ada Subject: GNAT bug with overriding and Limited_Controlled? Date: Mon, 26 Oct 2009 14:49:42 -0700 (PDT) Organization: http://groups.google.com Message-ID: <3335118d-85bd-40f5-8a7a-4cff74ffb269@j19g2000yqk.googlegroups.com> NNTP-Posting-Host: 85.1.157.25 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1256593783 9506 127.0.0.1 (26 Oct 2009 21:49:43 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 26 Oct 2009 21:49:43 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: j19g2000yqk.googlegroups.com; posting-host=85.1.157.25; posting-account=bMuEOQoAAACUUr_ghL3RBIi5neBZ5w_S User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3,gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:8800 Date: 2009-10-26T14:49:42-07:00 List-Id: While chasing some strange bug[*] I have stomped onto something interesting: with Ada.Finalization; procedure Test is package P is type T is new Ada.Finalization.Limited_Controlled with null record; overriding procedure Initialize (X : in out T); overriding procedure Adjust (X : in out T); overriding procedure Finalize (X : in out T); end P; package body P is procedure Initialize (X : in out T) is begin null; end Initialize; procedure Adjust (X : in out T) is begin null; end Adjust; procedure Finalize (X : in out T) is begin null; end Finalize; end P; begin null; end Test; As far as I understand, the Ada.Finalization.Limited_Controlled type has no Adjust operation. Therefore, the T type cannot override it. Yet the above is happily accepted by GNAT GPL 2009 (20090519). As an exercise try to misspell the operation name as a sanity check that the overriding keyword is recognized at all. Is it a compiler bug? I think so, but if not, where is the original magic Adjust that the above code is apparently overriding? -- Maciej Sobczak * www.msobczak.com * www.inspirel.com Database Access Library for Ada: www.inspirel.com/soci-ada