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-441


Tested on i686-linux, committed on trunk

This patch gives support to AI-441: Ada 95 compilers should support
"not null" on access parameters. The qualifier has no semantic meaning
in Ada 95 (all access parameters are "not null" in Ada 95). The follo-
wing test must now compile without errors with this command:
gcc -c -gnat95 test_pkg_05.ads
--
with Ada.Streams.Stream_IO;
package Test_Pkg_05 is
  type Test_Class is tagged null record;
  function Stream_Input
    (Stream : not null access Ada.Streams.Root_Stream_Type'Class)
    return Test_Class;
  for Test_Class'Input  use Stream_Input;
  procedure Stream_Output
    (Stream : not null access Ada.Streams.Root_Stream_Type'Class;
     Item   : in Test_Class);
  for Test_Class'Output use Stream_Output;
  procedure Stream_Read
   (Stream : not null access Ada.Streams.Root_Stream_Type'Class;
    Item   : out Test_Class);
  for Test_Class'Read use Stream_Read;
  procedure Stream_Write
   (Stream : not null access Ada.Streams.Root_Stream_Type'Class;
    Item   : in Test_Class);
  for Test_Class'Write use Stream_Write;
end Test_Pkg_05;

2005-11-14  Javier Miranda  <miranda@adacore.com>

	* exp_strm.adb (Build_Stream_Attr_Profile, Build_Stream_Function,
	Build_Stream_Procedure): Add the null-excluding attribute to the first
	formal.
	This has no semantic meaning under Ada95 mode but it is a
	requirement under Ada05 mode.

	* par-ch3.adb (P_Access_Definition): Addition of warning message if
	the null exclusion is used under Ada95 mode
	(P_Null_Exclusion): The qualifier has no semantic meaning in Ada 95.
	(P_Access_Definition): Remove assertion that forbids the use of
	the null-exclusion feature in Ada95.

Attachment: difs.30
Description: Text document


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