comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Persistence of limited tagged types
Date: Thu, 10 Apr 2003 13:49:53 -0500
Date: 2003-04-10T13:49:53-05:00	[thread overview]
Message-ID: <v9bf539r509i47@corp.supernews.com> (raw)
In-Reply-To: 1ec946d1.0304091509.150cc6d7@posting.google.com

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.







  parent reply	other threads:[~2003-04-10 18:49 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-07 12:47 Persistence of limited tagged types Jano
2003-04-07 14:47 ` Nick Roberts
2003-04-09 10:05   ` Nick Roberts
2003-04-10  3:32     ` tmoran
2003-04-09 23:09   ` Matthew Heaney
2003-04-10 14:40     ` Nick Roberts
2003-04-10 23:37       ` Robert A Duff
2003-04-11 16:39         ` Nick Roberts
2003-04-10 18:49     ` Randy Brukardt [this message]
2003-04-10  1:12   ` Matthew Heaney
2003-04-07 18:11 ` Stephen Leake
2003-04-07 19:07   ` Hyman Rosen
2003-04-07 22:09     ` Jano
2003-04-08 13:58       ` Matthew Heaney
2003-04-10 11:41         ` Julio Cano
2003-04-10 19:14           ` Jano
2003-04-11 12:54             ` Julio Cano
2003-04-07 20:17   ` Robert Spooner
2003-04-07 21:14     ` Stephen Leake
2003-04-08 12:56       ` Robert Spooner
2003-04-08 13:41         ` Jano
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox