comp.lang.ada
 help / color / mirror / Atom feed
* Disagreement between GNAT and Cohen?
@ 2002-06-11  0:33 Andrew Hoddinott
  2002-06-11  1:00 ` Robert A Duff
  2002-06-11  1:12 ` Preben Randhol
  0 siblings, 2 replies; 5+ messages in thread
From: Andrew Hoddinott @ 2002-06-11  0:33 UTC (permalink / raw)


With the declaration

package Test is
   type Set_Type is array (1 .. 3) of Boolean; -- for example
   function Union (Set_1, Set_2 : Set_Type) return Set_Type;
end Test;

the following code

package body Test is
   function Union (Set_1, Set_2 : Set_Type) return Set_Type is
   begin
      return Set_1 or Set_2;
   end Union;
end Test;

compiles without problem, but for

package body Test is
   function Union (Set_1, Set_2 : Set_Type) return Set_Type
      renames "or";
end Test;

GNAT (3.14p) gives an error:

test.adb:2:04: not subtype conformant with declaration in package Standard
test.adb:2:04: return type does not match
test.adb:3:15: subprogram used in renaming_as_body cannot be intrinsic

This kind of renaming is explicitly used by Cohen in a generics example
in section 15.2.3.2 of "Ada as a second language". (Cohen's full example
doesn't compile either, although only the first 2 lines of the error
message are generated).

Am I missing something obvious here? Or is Cohen wrong? Or GNAT? Is
there something in the RM that supports GNAT's claim that "subprogram
used in renaming_as_body cannot be intrinsic"?




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

end of thread, other threads:[~2002-06-13  1:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-06-11  0:33 Disagreement between GNAT and Cohen? Andrew Hoddinott
2002-06-11  1:00 ` Robert A Duff
2002-06-11  7:23   ` Andrew Hoddinott
2002-06-13  1:52     ` Robert A Duff
2002-06-11  1:12 ` Preben Randhol

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