+2014-07-29 Robert Dewar <dewar@adacore.com>
+
+ * sem_ch3.adb, sinfo.ads, types.ads, sem_prag.adb, a-except-2005.adb,
+ sem_ch6.adb, par-ch3.adb: Minor reformatting.
+
2014-07-29 Ed Schonberg <schonberg@adacore.com>
* sem_ch6.adb (Check_Return_Subtype_Indication): Reject a return
-- These routines raise a specific exception with a reason message
-- attached. The parameters are the file name and line number in each
-- case. The names are defined by Exp_Ch11.Get_RT_Exception_Name.
- -- Note that these routines should be declared in the same order as the
- -- corresponding Rmsg_xx constants below, this is needed by the
- -- .NET runtime (see exceptmsg.awk script).
+
+ -- Note on ordering of these routines. Normally in the Ada.Exceptions units
+ -- we don't care about the ordering of entries for Rcheck routines, and
+ -- the normal approach is to keep them in the same order as declarations
+ -- in Types.
+
+ -- This section is an IMPORTANT EXCEPTION. It is essential that the
+ -- routines in this section be declared in the same order as the Rmsg_xx
+ -- constants in the following section. This is required by the .Net runtime
+ -- which uses the exceptmsg.awk script to generate require exception data,
+ -- and this script requires and expects that this ordering rule holds.
procedure Rcheck_CE_Access_Check
(File : System.Address; Line : Integer);
(File : System.Address; Line : Integer);
procedure Rcheck_PE_Stream_Operation_Not_Allowed
(File : System.Address; Line : Integer);
-
procedure Rcheck_CE_Access_Check_Ext
(File : System.Address; Line, Column : Integer);
procedure Rcheck_CE_Index_Check_Ext
begin
if not Header_Already_Parsed then
- -- not null access .. is a common form of access definition
- -- access non null .. is certainly rare, but syntactically legal.
- -- not null access not null .. is rarer yet, and also legal.
+ -- NOT NULL ACCESS .. is a common form of access definition.
+ -- ACCESS NON NULL .. is certainly rare, but syntactically legal.
+ -- NOT NULL ACCESS NOT NULL .. is rarer yet, and also legal.
-- The last two cases are only meaningful if the following subtype
-- indication denotes an access type (semantic check).
Not_Null_Present := P_Null_Exclusion; -- Ada 2005 (AI-231)
Scan; -- past ACCESS
- Not_Null_Subtype := P_Null_Exclusion; -- Might also appear.
+ Not_Null_Subtype := P_Null_Exclusion; -- Might also appear
end if;
if Token_Name = Name_Protected then
Process_Subtype (S, P, T, 'P'));
end if;
- -- If the access definition is of the form : access not null ..
+ -- If the access definition is of the form: ACCESS NOT NULL ..
-- the subtype indication must be of an access type. Create
-- a null-excluding subtype of it.
Decl :=
Make_Subtype_Declaration (Loc,
Defining_Identifier => Nam,
- Subtype_Indication =>
+ Subtype_Indication =>
New_Occurrence_Of (Entity (S), Loc));
Set_Null_Exclusion_Present (Decl);
Insert_Before (Parent (Def), Decl);
-- In Ada 2005, the type may have a limited view through some unit in
-- its own context, allowing the following circularity that cannot be
- -- detected earlier
+ -- detected earlier.
elsif Is_Class_Wide_Type (Full_Desig) and then Etype (Full_Desig) = T
then
end if;
end if;
- -- Previous versions of this subprogram allowed the return value
- -- to be the ancestor of the return type if the return type was
- -- a null extension. This was plainly incorrect.
+ -- All remaining cases are illegal
+
+ -- Note: previous versions of this subprogram allowed the return
+ -- value to be the ancestor of the return type if the return type
+ -- was a null extension. This was plainly incorrect.
else
Error_Msg_N
-- integer address values. If Address is not private (e.g. on
-- VMS, where it is an integer type), then this pragma has no
-- purpose, so it is simply ignored.
+
-- If Allow_Integer_Address is already set do nothing, otherwise
-- calling RTE on RE_Address would cause a crash when loading
-- system.ads.
-- expected type is a thin pointer to unconstrained array. This flag is
-- to assist in detecting this illegal use of Unrestricted_Access.
+ -- Null_Excluding_Subtype (Flag16)
+ -- ??? needs documentation ???
+
-- Original_Discriminant (Node2-Sem)
-- Present in identifiers. Used in references to discriminants that
-- appear in generic units. Because the names of the discriminants may be
-- static string constant. Note that there is more than one version
-- of a-except.adb which must be modified.
+ -- Note on ordering of references. For the tables in Ada.Exceptions units,
+ -- usually the ordering does not matter, and we use the same ordering as
+ -- is used here (note the requirement in the ordering here that CE/PE/SE
+ -- codes be kept together, so the subtype declarations work OK). However,
+ -- there is an important exception, which is in a-except-2005.adb, where
+ -- ordering of the Rcheck routines must correspond to the ordering of the
+ -- Rmsg_xx messages. This is required by the .NET scripts.
+
type RT_Exception_Code is
(CE_Access_Check_Failed, -- 00
CE_Access_Parameter_Is_Null, -- 01