Commit c93f2011 by Robert Dewar Committed by Arnaud Charlet

g-rannum.adb, [...]: Minor reformatting.

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.

From-SVN: r220445
parent 71140fc6
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> 2015-02-05 Yannick Moy <moy@adacore.com>
* opt.ads (Warn_On_Suspicious_Contract): Update comment * opt.ads (Warn_On_Suspicious_Contract): Update comment
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- 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 -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -400,7 +400,14 @@ package body Exp_Ch13 is ...@@ -400,7 +400,14 @@ package body Exp_Ch13 is
-- Skip this for aspects (e.g. Current_Value) for which -- Skip this for aspects (e.g. Current_Value) for which
-- there is no corresponding pragma or attribute. -- 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)); pragma Assert (Is_Delayed_Aspect (Aitem));
Insert_Before (N, Aitem); Insert_Before (N, Aitem);
end if; end if;
......
...@@ -38,7 +38,6 @@ with System.Random_Numbers; use System.Random_Numbers; ...@@ -38,7 +38,6 @@ with System.Random_Numbers; use System.Random_Numbers;
package body GNAT.Random_Numbers with package body GNAT.Random_Numbers with
SPARK_Mode => Off SPARK_Mode => Off
is is
Sys_Max_Image_Width : constant := System.Random_Numbers.Max_Image_Width; Sys_Max_Image_Width : constant := System.Random_Numbers.Max_Image_Width;
subtype Image_String is String (1 .. Max_Image_Width); subtype Image_String is String (1 .. Max_Image_Width);
......
...@@ -57,7 +57,6 @@ with Interfaces; use Interfaces; ...@@ -57,7 +57,6 @@ with Interfaces; use Interfaces;
package GNAT.Random_Numbers with package GNAT.Random_Numbers with
SPARK_Mode => Off SPARK_Mode => Off
is is
type Generator is limited private; type Generator is limited private;
subtype Initialization_Vector is subtype Initialization_Vector is
System.Random_Numbers.Initialization_Vector; System.Random_Numbers.Initialization_Vector;
......
...@@ -97,8 +97,8 @@ use Ada; ...@@ -97,8 +97,8 @@ use Ada;
package body System.Random_Numbers with package body System.Random_Numbers with
SPARK_Mode => Off SPARK_Mode => Off
is is
Image_Numeral_Length : constant := Max_Image_Width / N; Image_Numeral_Length : constant := Max_Image_Width / N;
subtype Image_String is String (1 .. Max_Image_Width); subtype Image_String is String (1 .. Max_Image_Width);
---------------------------- ----------------------------
......
...@@ -60,7 +60,6 @@ with Interfaces; ...@@ -60,7 +60,6 @@ with Interfaces;
package System.Random_Numbers with package System.Random_Numbers with
SPARK_Mode => Off SPARK_Mode => Off
is is
type Generator is limited private; type Generator is limited private;
-- Generator encodes the current state of a random number stream, it is -- Generator encodes the current state of a random number stream, it is
-- provided as input to produce the next random number, and updated so -- provided as input to produce the next random number, and updated so
......
...@@ -15704,6 +15704,13 @@ package body Sem_Prag is ...@@ -15704,6 +15704,13 @@ package body Sem_Prag is
("pragma% only allowed for private type", Arg1); ("pragma% only allowed for private type", Arg1);
end if; 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 -- Note that the type has at least one invariant, and also that
-- it has inheritable invariants if we have Invariant'Class -- it has inheritable invariants if we have Invariant'Class
-- or Type_Invariant'Class. Build the corresponding invariant -- or Type_Invariant'Class. Build the corresponding invariant
......
...@@ -217,7 +217,7 @@ package Sem_Warn is ...@@ -217,7 +217,7 @@ package Sem_Warn is
procedure Warn_On_Suspicious_Update (N : Node_Id); procedure Warn_On_Suspicious_Update (N : Node_Id);
-- N is a semantically analyzed attribute reference Prefix'Update. Issue -- 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 -- 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(...) -- Prefix = Prefix'Update(...)
-- or -- or
-- Prefix'Update(...) = Prefix -- Prefix'Update(...) = Prefix
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment