Profile : List_Id;
begin
+ -- (Ada 2005: AI-441): Set the null-excluding attribute because it has
+ -- no semantic meaning in Ada 95 but it is a requirement in Ada2005.
+
Profile := New_List (
Make_Parameter_Specification (Loc,
Defining_Identifier => Make_Defining_Identifier (Loc, Name_S),
Parameter_Type =>
Make_Access_Definition (Loc,
+ Null_Exclusion_Present => True,
Subtype_Mark => New_Reference_To (
Class_Wide_Type (RTE (RE_Root_Stream_Type)), Loc))));
begin
-- Construct function specification
+ -- (Ada 2005: AI-441): Set the null-excluding attribute because it has
+ -- no semantic meaning in Ada 95 but it is a requirement in Ada2005.
+
Spec :=
Make_Function_Specification (Loc,
Defining_Unit_Name => Fnam,
Defining_Identifier => Make_Defining_Identifier (Loc, Name_S),
Parameter_Type =>
Make_Access_Definition (Loc,
+ Null_Exclusion_Present => True,
Subtype_Mark => New_Reference_To (
Class_Wide_Type (RTE (RE_Root_Stream_Type)), Loc)))),
begin
-- Construct procedure specification
+ -- (Ada 2005: AI-441): Set the null-excluding attribute because it has
+ -- no semantic meaning in Ada 95 but it is a requirement in Ada2005.
+
Spec :=
Make_Procedure_Specification (Loc,
Defining_Unit_Name => Pnam,
Defining_Identifier => Make_Defining_Identifier (Loc, Name_S),
Parameter_Type =>
Make_Access_Definition (Loc,
+ Null_Exclusion_Present => True,
Subtype_Mark => New_Reference_To (
Class_Wide_Type (RTE (RE_Root_Stream_Type)), Loc))),
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2005 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005, 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- --
return False;
else
+ -- Ada 2005 (AI-441): The qualifier has no semantic meaning in Ada 95
+ -- (all access Parameters Are "not null" in Ada 95).
+
if Ada_Version < Ada_05 then
Error_Msg_SP
- ("null-excluding access is an Ada 2005 extension");
- Error_Msg_SP ("\unit must be compiled with -gnat05 switch");
+ ("null-excluding access is an Ada 2005 extension?");
+ Error_Msg_SP ("\unit should be compiled with -gnat05 switch?");
end if;
Scan; -- past NOT
-- Ada 95
else
- -- Ada 2005 (AI-254): The null-exclusion present is never present
- -- in Ada 83 and Ada 95
-
- pragma Assert (Null_Exclusion_Present = False);
-
Set_Null_Exclusion_Present (Def_Node, False);
Set_Subtype_Mark (Def_Node, P_Subtype_Mark);
No_Constraint;