comp.lang.ada
 help / color / mirror / Atom feed
From: Damien Carbonne <damien.carbonne@free.fr>
Subject: GNAT: bug or feature?
Date: Sun, 14 Mar 2010 22:16:57 +0100
Date: 2010-03-14T22:16:58+01:00	[thread overview]
Message-ID: <4b9d524a$0$22397$426a74cc@news.free.fr> (raw)

Hi,

When compiled with GNAT GPL 2009 or GNAT GCC 4.4.1 / Ubuntu 9.10, the 
following code:

---------------------------------------------------
package Pack07 is

    type Base is tagged null record;
    function Create return Base;

    type Derived is new Base with null record;

end Pack07;
---------------------------------------------------

exhibits different compiler reactions depending on used options.

With 'gcc -c -gnat95 pack07.ads', I get:

pack07.ads:6:09: type must be declared abstract or "Create" overridden
pack07.ads:6:09: "Create" has been inherited at line 6
pack07.ads:6:09: "Create" has been inherited from subprogram at line 4

This is what I expect.

With 'gcc -c -gnat05 pack07.ads", the compiler tells nothing and seems 
to generate code.

I find this surprising.
I would consider this is a compiler bug. Is this the case or is it a new 
Ada 2005 feature?
May be it is due to an installation problem, but it would be surprising.

What is your opinion about this behavior?

Regards,
Damien Carbonne



             reply	other threads:[~2010-03-14 21:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-14 21:16 Damien Carbonne [this message]
2010-03-15  0:49 ` GNAT: bug or feature? Robert A Duff
2010-03-15 10:05   ` AdaMagica
2010-03-15 20:03     ` Damien Carbonne
2010-03-15 21:21       ` Robert A Duff
replies disabled

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