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.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,6cbbf1799c1dc6da X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news2.google.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "Alex R. Mosteo" Newsgroups: comp.lang.ada Subject: Re: Ada 2005 box (<>) rules in default values Date: Wed, 18 Jan 2006 16:59:36 +0100 Message-ID: <43CE65E8.1040307@mailinator.com> References: <43CCAB76.6050907@mailinator.com> <43CE20CF.4080801@mailinator.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Trace: individual.net dd0hQwmm6i4UsfMjS07tmAtugHQ229DehN37nIOMUsK7N6u2I= User-Agent: Mozilla Thunderbird 1.0.7 (X11/20051013) X-Accept-Language: en-us, en In-Reply-To: Xref: g2news1.google.com comp.lang.ada:2521 Date: 2006-01-18T16:59:36+01:00 List-Id: Jean-Pierre Rosen wrote: > Alex R. Mosteo a �crit : > >> Bj�rn Persson wrote: >> >>> This appears to be corrected in GCC 4.0.2 on Gnu/Linux, as it passes >>> the test below. Alex, could you please compile this program and >>> verify that it triggers the bug in your environment? If not, you >>> might want to post a compilable test case that does display the error. >> >> >> >> I'm sorry the example I wrote was made up on the way. Upon reflexion, >> I think I always saw this problem in relation with Controlled types. >> Here's an example which fails with my current GPL: >> >> with Ada.Text_IO; use Ada.Text_IO; >> with Ada.Finalization; use Ada.Finalization; >> >> procedure Bug2005 is >> >> type Thing is new Controlled with record >> First_Component : Integer; >> Second_Component : Integer; >> Third_Component : Integer; >> end record; >> >> procedure Initialize (This : in out Thing) is >> begin >> This.Third_Component := 5; >> end Initialize; >> >> type Superthing is record >> Innerthing : Thing; >> end record; >> >> Blah : Superthing := (others => <>); >> Bleh : Superthing; >> Blih : constant Superthing := (others => <>); >> Bloh : constant Superthing := (Innerthing => <>); >> Bluh : constant Superthing := (Innerthing => >> (Controlled with others => <>)); >> >> begin >> Put_Line(": Blah.Innerthing.Third_Component = " & >> Integer'Image(Blah.Innerthing.Third_Component)); >> Put_Line(": Bleh.Innerthing.Third_Component = " & >> Integer'Image(Bleh.Innerthing.Third_Component)); >> Put_Line(": Blih.Innerthing.Third_Component = " & >> Integer'Image(Blih.Innerthing.Third_Component)); >> Put_Line(": Bloh.Innerthing.Third_Component = " & >> Integer'Image(Bloh.Innerthing.Third_Component)); >> Put_Line(": Bluh.Innerthing.Third_Component = " & >> Integer'Image(Bluh.Innerthing.Third_Component)); >> end Bug2005; >> > That's totally different. Third_Component is not default-initialized, it > is initialized by the Initialize procedure. And Initialize is /not/ > called on aggregates. Yes, I said something about it in the part not quoted. But what about the other RM paragraphs I've quoted? Am I misinterpreting them? Really exists the problem I'm suggesting?