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: a07f3367d7,4b758210c0900d03 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!postnews.google.com!d27g2000yqn.googlegroups.com!not-for-mail From: sjw Newsgroups: comp.lang.ada Subject: Re: Protected object which never get finalized Date: Mon, 15 Feb 2010 10:08:18 -0800 (PST) Organization: http://groups.google.com Message-ID: References: NNTP-Posting-Host: 82.30.110.254 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1266257298 30548 127.0.0.1 (15 Feb 2010 18:08:18 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 15 Feb 2010 18:08:18 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: d27g2000yqn.googlegroups.com; posting-host=82.30.110.254; posting-account=_RXWmAoAAADQS3ojtLFDmTNJCT0N2R4U User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_2; en-us) AppleWebKit/531.21.8 (KHTML, like Gecko) Version/4.0.4 Safari/531.21.10,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:9242 Date: 2010-02-15T10:08:18-08:00 List-Id: On Feb 14, 12:35=A0pm, "John B. Matthews" wrote: > I get the same result with gcc 4.3.4, but it works if protected type > A_Type is public in P: > > =A0 =A0package P is > =A0 =A0 =A0 protected type A_Type is > =A0 =A0 =A0 private > =A0 =A0 =A0 =A0 =A0 Spy : Spies.Instance_Type > =A0 =A0 =A0 =A0 =A0 =A0 (Client_Name =3D> new String'("P.A_Type")); > =A0 =A0 =A0 end; > =A0 =A0end P; > > Type A_Type has its own private part, and this seems more comparable to > the declaration of protected type B_Type. Is there any reason to make > A_Type more opaque? I had wanted to write private Name : aliased constant String :=3D "P.A_Type"; protected type A_Type is private Spy : Spies.Instance_Type (Client_Name =3D> Name'Access); end; end P; to avoid allocating a new Client_Name at each instance creation. This looks a little messy if in the public part.