From: Robert Dewar Date: Thu, 5 Feb 2015 11:17:25 +0000 (+0000) Subject: g-rannum.adb, [...]: Minor reformatting. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c93f201145542240f9b197b17c06ddab696bbfd4;p=gcc.git g-rannum.adb, [...]: Minor reformatting. 2015-02-05 Robert Dewar * 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 --- diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 7ad5878c342..acadafe214c 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,12 @@ +2015-02-05 Robert Dewar + + * 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 * opt.ads (Warn_On_Suspicious_Contract): Update comment diff --git a/gcc/ada/exp_ch13.adb b/gcc/ada/exp_ch13.adb index 856fb74e63d..65fa3238a49 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 39e92e19a31..3e802eeeaa9 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 8eadf669a2b..cf2889c4581 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 e31a2dca36e..f722f6c0254 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 8331c039c5c..a98631158e8 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 108c99190c2..8951059c98b 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 c441f28b889..b1f2af22da1 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