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] AI 435


Tested on i686-linux, committed on trunk.

This is Ada 2005 AI-435, see
http://www.ada-auth.org/cgi-bin/cvsweb.cgi/AIs/AI-00435.TXT?rev=1.3
This AI makes it illegal to use Storage_Pool or Storage_Size
attributes on access to subprogram types (previously allowed),
and also to specify a storage pool for an access to subprogram
type (previously disallowed but now gives clearer error msg).

A simple test program is:

     1. with Ada.Text_IO;
     2. procedure Fooey is
     3.    type Acc_Proc is access procedure;
     4.
     5.    type Acc_Int is access Integer;
     6.    for Acc_Int'Storage_Pool use Acc_Proc'Storage_Pool;
                                        |
        >>> cannot use "Storage_Pool" attribute for
            access-to-subprogram type

     7.
     8.    What : constant Integer := Acc_Proc'Storage_Size;
                                      |
        >>> cannot use "Storage_Size" attribute for
            access-to-subprogram type

     9.
    10.    type M_Acc_Int is access Integer;
    11.    type M_Acc_Proc is access procedure;
    12.    for M_Acc_Proc'Storage_Pool use M_Acc_Int'Storage_Pool;
               |
        >>> storage pool cannot be given for
            access-to-subprogram type

    13.
    14. begin
    15.    Ada.Text_IO.Put_Line
    16.      ("Storage size of access to procedure = " &
    17.       Integer'Image (What));
    18. end Fooey;

Also implement Ada 2005 AI-240
See http://www.ada-auth.org/cgi-bin/cvsweb.cgi/AIs/AI-00240.TXT?rev=1.6

2006-10-31  Robert Dewar  <dewar@adacore.com>
	    Thomas Quinot  <quinot@adacore.com>

	* sem_ch13.adb: Storage pool cannot be given for access to subprogram
	type.
	(New_Stream_Subprogram): When processing an attribute definition clause
	for a stream-oriented subprogram, record an entity node occurring at
	the point of clause to use for checking the visibility of the clause,
	as defined by 8.3(23) as amended by AI-195.
	(New_Stream_Subprogram): New procedure, factoring behaviour from both
	 New_Stream_Function and New_Stream_Procedure.
	(New_Stream_Function, New_Stream_Procedure): Removed.
	(Analyze_Attribute_Definition_Clause, case Address): Check new
	Alignment_Check check

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]