aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/par-ch6.adb
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/par-ch6.adb')
-rw-r--r--gcc/ada/par-ch6.adb21
1 files changed, 18 insertions, 3 deletions
diff --git a/gcc/ada/par-ch6.adb b/gcc/ada/par-ch6.adb
index cc0e898..964a9a6 100644
--- a/gcc/ada/par-ch6.adb
+++ b/gcc/ada/par-ch6.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2003 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2004 Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -857,6 +857,7 @@ package body Ch6 is
Num_Idents : Nat;
Ident : Nat;
Ident_Sloc : Source_Ptr;
+ Not_Null_Present : Boolean := False;
Idents : array (Int range 1 .. 4096) of Entity_Id;
-- This array holds the list of defining identifiers. The upper bound
@@ -865,7 +866,6 @@ package body Ch6 is
begin
Specification_List := New_List;
-
Specification_Loop : loop
begin
if Token = Tok_Pragma then
@@ -953,8 +953,12 @@ package body Ch6 is
Specification_Node :=
New_Node (N_Parameter_Specification, Ident_Sloc);
Set_Defining_Identifier (Specification_Node, Idents (Ident));
+ Not_Null_Present := P_Null_Exclusion; -- Ada 0Y (AI-231)
if Token = Tok_Access then
+ Set_Null_Exclusion_Present
+ (Specification_Node, Not_Null_Present);
+
if Ada_83 then
Error_Msg_SC ("(Ada 83) access parameters not allowed");
end if;
@@ -963,7 +967,18 @@ package body Ch6 is
(Specification_Node, P_Access_Definition);
else
- P_Mode (Specification_Node);
+ if Token = Tok_In or else Token = Tok_Out then
+ if Not_Null_Present then
+ Error_Msg_SC
+ ("ACCESS must be placed after the parameter mode");
+ end if;
+
+ P_Mode (Specification_Node);
+ Not_Null_Present := P_Null_Exclusion; -- Ada 0Y (AI-231)
+ end if;
+
+ Set_Null_Exclusion_Present
+ (Specification_Node, Not_Null_Present);
if Token = Tok_Procedure
or else