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: 103376,ee82e0a06c8bbead,start X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.125.233 with SMTP id mt9mr8085190pbb.5.1333759470696; Fri, 06 Apr 2012 17:44:30 -0700 (PDT) Path: r9ni27068pbh.0!nntp.google.com!news2.google.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: sbelmont700@gmail.com Newsgroups: comp.lang.ada Subject: A Gnother Gnasty bug Date: Fri, 6 Apr 2012 17:44:30 -0700 (PDT) Organization: http://groups.google.com Message-ID: <22193583.1528.1333759470339.JavaMail.geo-discussion-forums@vbdn7> NNTP-Posting-Host: 206.53.78.59 Mime-Version: 1.0 X-Trace: posting.google.com 1333759470 9694 127.0.0.1 (7 Apr 2012 00:44:30 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sat, 7 Apr 2012 00:44:30 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=206.53.78.59; posting-account=ShYTIAoAAABytvcS76ZrG9GdaV-nXYKy User-Agent: G2/1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Date: 2012-04-06T17:44:30-07:00 List-Id: Hi everyone, I've stumbled across another dubious GNAT GPL 2011 situation, yet this one = is convoluted enough to perhaps be mistaken thinking on my part, so I would= be appreciative of any independent tests before I submit it. Additionally= , I would like to try to describe it using the rich Ada lexicon, so please = check me on that as well: "When an object of a limited record type containing an object of a non-limi= ted controlled record type which contains an access value to a classwide ty= pe is created from a value-returning function whose argument is supplied fr= om another value-returning function whose argument is supplied from a class= wide allocator, a constraint error is raised." It's clearly an edge case, and would not surprise me if it is related to a = different bug where allocating a classwide type mangles the dispatch table,= but as this behavior is different in that an exception is raised instead o= f erroneous execution, perhaps it's something else entirely, or maybe even = doing what it's supposed to do (in which case please explain it to me). A small test procedure that demonstrates this behavior is as follows: with Ada.Finalization; procedure test is type I is limited interface; =20 type I_Ptr is access I'class; =20 type C is new Ada.Finalization.Limited_Controlled and I with record d : integer; end record; =20 function F (arg : Integer) return I'class is begin return C'(Ada.Finalization.Limited_Controlled with d =3D> arg); end F; =20 type K is new Ada.Finalization.Controlled with record e : I_Ptr; end record; =20 function G (p_i : I_Ptr) return K is begin return K'(Ada.Finalization.Controlled with e =3D> p_i); end G; =20 type J is limited record h : K; end record; =20 function H (arg : K) return J is begin return J'(h =3D> arg); end H; =20 x : J :=3D H(arg =3D> G(p_i =3D>=20 I_Ptr'(new I'class'(F(arg=3D> 42))))); begin null; end test;