+2015-02-05 Robert Dewar <dewar@adacore.com>
+
+ * g-rannum.adb, g-rannum.ads, s-rannum.adb, s-rannum.ads,
+ sem_warn.ads: Minor reformatting.
+ * exp_ch13.adb (Expand_N_Freeze_Entity): Add guard for aspect
+ deleted by -gnatI.
+ * sem_prag.adb (Analyze_Pragma, case Type_Invariant): Give
+ error for abstract type.
+
2015-02-05 Yannick Moy <moy@adacore.com>
* opt.ads (Warn_On_Suspicious_Contract): Update comment
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2014, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2015, 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- --
-- Skip this for aspects (e.g. Current_Value) for which
-- there is no corresponding pragma or attribute.
- if Present (Aitem) then
+ if Present (Aitem)
+
+ -- Also skip if we have a null statement rather than a
+ -- delayed aspect (this happens when we are ignoring rep
+ -- items from use of the -gnatI switch).
+
+ and then Nkind (Aitem) /= N_Null_Statement
+ then
pragma Assert (Is_Delayed_Aspect (Aitem));
Insert_Before (N, Aitem);
end if;
package body GNAT.Random_Numbers with
SPARK_Mode => Off
is
-
Sys_Max_Image_Width : constant := System.Random_Numbers.Max_Image_Width;
subtype Image_String is String (1 .. Max_Image_Width);
package GNAT.Random_Numbers with
SPARK_Mode => Off
is
-
type Generator is limited private;
subtype Initialization_Vector is
System.Random_Numbers.Initialization_Vector;
package body System.Random_Numbers with
SPARK_Mode => Off
is
-
Image_Numeral_Length : constant := Max_Image_Width / N;
+
subtype Image_String is String (1 .. Max_Image_Width);
----------------------------
package System.Random_Numbers with
SPARK_Mode => Off
is
-
type Generator is limited private;
-- Generator encodes the current state of a random number stream, it is
-- provided as input to produce the next random number, and updated so
("pragma% only allowed for private type", Arg1);
end if;
+ -- Not allowed for abstract type
+
+ if Is_Abstract_Type (Typ) then
+ Error_Pragma_Arg
+ ("pragma% not allowed for abstract type", Arg1);
+ end if;
+
-- Note that the type has at least one invariant, and also that
-- it has inheritable invariants if we have Invariant'Class
-- or Type_Invariant'Class. Build the corresponding invariant
procedure Warn_On_Suspicious_Update (N : Node_Id);
-- N is a semantically analyzed attribute reference Prefix'Update. Issue
-- a warning if Warn_On_Suspicious_Contract is set, and N is the left-hand
- -- side or right-hand side of an equality or disequality of the form:
+ -- side or right-hand side of an equality or inequality of the form:
-- Prefix = Prefix'Update(...)
-- or
-- Prefix'Update(...) = Prefix