comp.lang.ada
 help / color / mirror / Atom feed
From: Andreas Almroth <andreas-nntp@almroth.com>
Subject: Re: Return value that is an access to array element
Date: 06 Aug 2002 01:32:20 +0200
Date: 2002-08-06T01:32:20+02:00	[thread overview]
Message-ID: <87wur46fwb.fsf@almroth.com> (raw)
In-Reply-To: aimap3$ihe$1@paris.btinternet.com

"Martin Dowie" <martin.dowie@btopenworld.com> writes:

> Given the following code, should a compiler raise an error given
> LM 3.10.2 (25) as an error or not?
> 
> generic
>    type T is private;
>    type TA is access all T;
> package Foo is
>    type XT is private;
>    function Get (X : XT) return TA;
> private
>    type AT is array (Positive range <>) of aliased T;
>    type AA is access AT;
>    type XT is record
>       A : AA;
>    end record;
> end Foo;
> 
> package body Foo is
>    function Get (X : XT) return TA is
>    begin
>       return X.A (1)'Access;  -- Error here?
>    end Get;
> end Foo;

?

GNAT 3.14p sure gives an error saying you can't use AT as an type, as it is a 
reserved word.

Compiles just fine when changes to something else...

My $0.25,
Andreas





      reply	other threads:[~2002-08-05 23:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-08-05 16:57 Return value that is an access to array element Martin Dowie
2002-08-05 23:32 ` Andreas Almroth [this message]
replies disabled

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