Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

GNAT GPL 2011 bug ?

11 views
Skip to first unread message

David

unread,
Feb 7, 2012, 7:05:14 AM2/7/12
to
Hi all,

The compiler accept the line mark by a arrow of the adb bellow and
refuse the line mark by "****". I think it must not accept the first
line to. What do you think ?

Thanks

------- ads --------

type I is interface;

procedure set (Self : out I;
Value : in Natural) is abstract;


type A is abstract tagged null record;

procedure set (Self : out A;
Value : in Natural) is abstract;


type Implement_I is new I with null record;

overriding procedure set (Self : out Implement_I;
Value : in Natural) is
null;

Null_Implement_I : constant Implement_I := Implement_I'(null
record);

type Implement_A is new A with null record;

overriding procedure set (Self : out Implement_A;
Value : in Natural) is null;

Null_Implement_A : constant Implement_A := Implement_A'(null
record);

procedure Test;



--- adb ---

procedure Test
is
L_I : constant test.I'Class := Null_Implement_I;
L_A : constant test.A'Class := Null_Implement_A;
begin
L_I.set (Value => 2); <--------
L_A.set (Value => 2); *******
end;

Adam Beneschan

unread,
Feb 7, 2012, 10:50:41 AM2/7/12
to
On Feb 7, 4:05 am, David <d.combesdhen...@gmail.com> wrote:
> Hi all,
>
> The compiler accept the line mark by a arrow of the adb bellow and
> refuse the line mark by "****". I think it must not accept the first
> line to. What do you think ?

I agree, it's a bug. It shouldn't allow a constant L_I to be passed
as an OUT parameter.

-- Adam

Adam Beneschan

unread,
Feb 7, 2012, 11:01:54 AM2/7/12
to
On Feb 7, 7:50 am, Adam Beneschan <a...@irvine.com> wrote:
> On Feb 7, 4:05 am, David <d.combesdhen...@gmail.com> wrote:
>
> > Hi all,
>
> > The compiler accept the line mark by a arrow of the adb bellow and
> > refuse the line mark by "****". I think it must not accept the first
> > line to. What do you think ?
>
> I agree, it's a bug.  It shouldn't allow a constant L_I to be passed
> as an OUT parameter.

Before somebody else nitpicks, I don't think it's possible for the
Test procedure to declare an object of type Test.L_I'Class since L_I
isn't declared inside Test. I stuck the code in a package and changed
Test.L_I to use the package name before trying it.

-- Adam
0 new messages