comp.lang.ada
 help / color / mirror / Atom feed
* GNAT: bug or feature?
@ 2010-03-14 21:16 Damien Carbonne
  2010-03-15  0:49 ` Robert A Duff
  0 siblings, 1 reply; 5+ messages in thread
From: Damien Carbonne @ 2010-03-14 21:16 UTC (permalink / 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



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-03-15 21:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-14 21:16 GNAT: bug or feature? Damien Carbonne
2010-03-15  0:49 ` Robert A Duff
2010-03-15 10:05   ` AdaMagica
2010-03-15 20:03     ` Damien Carbonne
2010-03-15 21:21       ` Robert A Duff

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