aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRobert Dewar <dewar@adacore.com>2015-02-05 11:17:25 +0000
committerArnaud Charlet <charlet@gcc.gnu.org>2015-02-05 12:17:25 +0100
commitc93f201145542240f9b197b17c06ddab696bbfd4 (patch)
treeac9371e2bf91d0005b7f52c36eb36a0184fe05d6 /gcc
parent71140fc6ca792f3666e126b5eec4640193741ae2 (diff)
downloadgcc-c93f201145542240f9b197b17c06ddab696bbfd4.zip
gcc-c93f201145542240f9b197b17c06ddab696bbfd4.tar.gz
gcc-c93f201145542240f9b197b17c06ddab696bbfd4.tar.bz2
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/ChangeLog9
-rw-r--r--gcc/ada/exp_ch13.adb11
-rw-r--r--gcc/ada/g-rannum.adb1
-rw-r--r--gcc/ada/g-rannum.ads1
-rw-r--r--gcc/ada/s-rannum.adb2
-rw-r--r--gcc/ada/s-rannum.ads1
-rw-r--r--gcc/ada/sem_prag.adb7
-rw-r--r--gcc/ada/sem_warn.ads2
8 files changed, 27 insertions, 7 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 7ad5878..acadafe 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,12 @@
+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
diff --git a/gcc/ada/exp_ch13.adb b/gcc/ada/exp_ch13.adb
index 856fb74..65fa323 100644
--- a/gcc/ada/exp_ch13.adb
+++ b/gcc/ada/exp_ch13.adb
@@ -6,7 +6,7 @@
-- --
-- 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- --
@@ -400,7 +400,14 @@ package body Exp_Ch13 is
-- 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;
diff --git a/gcc/ada/g-rannum.adb b/gcc/ada/g-rannum.adb
index 39e92e1..3e802ee 100644
--- a/gcc/ada/g-rannum.adb
+++ b/gcc/ada/g-rannum.adb
@@ -38,7 +38,6 @@ with System.Random_Numbers; use System.Random_Numbers;
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);
diff --git a/gcc/ada/g-rannum.ads b/gcc/ada/g-rannum.ads
index 8eadf66..cf2889c 100644
--- a/gcc/ada/g-rannum.ads
+++ b/gcc/ada/g-rannum.ads
@@ -57,7 +57,6 @@ with Interfaces; use Interfaces;
package GNAT.Random_Numbers with
SPARK_Mode => Off
is
-
type Generator is limited private;
subtype Initialization_Vector is
System.Random_Numbers.Initialization_Vector;
diff --git a/gcc/ada/s-rannum.adb b/gcc/ada/s-rannum.adb
index e31a2dc..f722f6c 100644
--- a/gcc/ada/s-rannum.adb
+++ b/gcc/ada/s-rannum.adb
@@ -97,8 +97,8 @@ use Ada;
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);
----------------------------
diff --git a/gcc/ada/s-rannum.ads b/gcc/ada/s-rannum.ads
index 8331c03..a986311 100644
--- a/gcc/ada/s-rannum.ads
+++ b/gcc/ada/s-rannum.ads
@@ -60,7 +60,6 @@ with Interfaces;
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
diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb
index 108c991..8951059 100644
--- a/gcc/ada/sem_prag.adb
+++ b/gcc/ada/sem_prag.adb
@@ -15704,6 +15704,13 @@ package body Sem_Prag is
("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
diff --git a/gcc/ada/sem_warn.ads b/gcc/ada/sem_warn.ads
index c441f28..b1f2af2 100644
--- a/gcc/ada/sem_warn.ads
+++ b/gcc/ada/sem_warn.ads
@@ -217,7 +217,7 @@ package Sem_Warn is
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