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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,6eac62e4f2badf3a X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-04-10 11:49:07 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!sn-xit-03!sn-xit-01!sn-post-01!supernews.com!corp.supernews.com!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Persistence of limited tagged types Date: Thu, 10 Apr 2003 13:49:53 -0500 Organization: Posted via Supernews, http://www.supernews.com Message-ID: References: <1ec946d1.0304091509.150cc6d7@posting.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Newsreader: Microsoft Outlook Express 4.72.3612.1700 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3719.2500 X-Complaints-To: abuse@supernews.com Xref: archiver1.google.com comp.lang.ada:36064 Date: 2003-04-10T13:49:53-05:00 List-Id: Matthew Heaney wrote in message <1ec946d1.0304091509.150cc6d7@posting.google.com>... >Is T'Output available if type T is limited? > >GNAT lets me declare an output operation: > > type T is limited null record; > > procedure Output > (Stream : access Root_Stream_Type'Class; > Item : in T); > > for T'Output use Output; > >but then it refuses to let me call it: > > O : T; >begin > T'Output (Stream, O); >end; > >I get an error message that "limited type T has no stream attributes." > >What's up with that? Is the expectation that T'Output can't be used >for a limited type? Why does GNAT allow me to define the T'Output >stream attribute? GNAT apparently has a bug here. Ada 95 always allowed calling of redefined limited attributes; it's illegal to call ones that aren't redefined. The Corrigendum changed this some, so that there are now some cases where you're allowed to call limited stream attributes even when they weren't defined. However, that was pretty buggy (there are cases where you're allowed to call something that doesn't exist), and we had to change it all again for the amendment. But those cases don't apply here. The current 13.13.2(36/1) allows this call, and the original 13.13.2(36) did as well. So, I'd send a bug report to ACT. (Note that the trouble with the various standards is with the class-wide calls. I could imagine a compiler disallowing that; while the ARG has approved rules that allow such calls, they won't be officially part of the standard until the Amendment is finished. So a compiler wouldn't be wrong to disallow them now.) Randy.