This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Ada] Allow tagged types to not violate No_Streams


Recently the No_Streams restriction was strengthened to prevent the
use of stream attributes. This included both explicit and implicit
uses, and in particular the implicit use in conjunction with tagged
type dispatching was included.

This creates an undesirable incompatibility, and this patch now
tests only for explicit use of stream attributes. The following
program compiles and binds without error:

package nostr is
   pragma Elaborate_Body;
end nostr;

pragma Restrictions (No_Streams);
package body nostr is
end nostr;

with nostr;
procedure nostrm is
   package p is
      type q is tagged record
         a : integer;
      end record;
   end p;
begin
   null;
end;

Tested on x86_64-pc-linux-gnu, committed on trunk

2009-04-17  Robert Dewar  <dewar@adacore.com>

	* gnat_rm.texi:
	Add documentation about No_Streams restriction
	
	* sem_attr.adb:
	(Check_Stream_Attribute): Exclude implicit stream attributes when
	 checking No_Streams restriction.
	
	For HB07-011 (also H812-020)

Attachment: difs
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]