summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbosch <bosch@138bc75d-0d04-0410-961f-82ee72b054a4>2001-10-12 00:28:21 +0000
committerbosch <bosch@138bc75d-0d04-0410-961f-82ee72b054a4>2001-10-12 00:28:21 +0000
commit09009ce9f66d0c2ebd5216c3b26fa658bf404ec0 (patch)
treedf5c4a0afa243e0bf92100efe3d12d5823ee2a25
parenta7b4d0777f64ffceedfc656aab24815db3406891 (diff)
downloadgcc-09009ce9f66d0c2ebd5216c3b26fa658bf404ec0.tar.gz
* sem_ch5.adb (Analyze_Iteration_Scheme): Suppress warning on null
loop in generic instance, since this is likely not very useful. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@46215 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ada/ChangeLog5
-rw-r--r--gcc/ada/sem_ch5.adb10
2 files changed, 11 insertions, 4 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index b21f3c51ae5..942f41849b9 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,5 +1,10 @@
2001-10-11 Robert Dewar <dewar@gnat.com>
+ * sem_ch5.adb (Analyze_Iteration_Scheme): Suppress warning on null
+ loop in generic instance, since this is likely not very useful.
+
+2001-10-11 Robert Dewar <dewar@gnat.com>
+
* restrict.adb (Disallow in No_Run_Time_Mode): Properly specialize
the error message for high integrity mode.
diff --git a/gcc/ada/sem_ch5.adb b/gcc/ada/sem_ch5.adb
index 658a685ced7..5fc1585077f 100644
--- a/gcc/ada/sem_ch5.adb
+++ b/gcc/ada/sem_ch5.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- $Revision: 1.262 $
+-- $Revision$
-- --
-- Copyright (C) 1992-2001 Free Software Foundation, Inc. --
-- --
@@ -941,11 +941,15 @@ package body Sem_Ch5 is
F := Freeze_Entity (Id, Sloc (LP));
pragma Assert (F = No_List);
- -- Check for null or possibly null range and issue warning
+ -- Check for null or possibly null range and issue warning.
+ -- We suppress such messages in generic templates and
+ -- instances, because in practice they tend to be dubious
+ -- in these cases.
if Nkind (DS) = N_Range
and then Comes_From_Source (N)
and then not Inside_A_Generic
+ and then not In_Instance
then
declare
L : constant Node_Id := Low_Bound (DS);
@@ -965,11 +969,9 @@ package body Sem_Ch5 is
-- If range of loop is null, issue warning
if (LOK and HOK) and then Llo > Hhi then
- Warn_On_Instance := True;
Error_Msg_N
("?loop range is null, loop will not execute",
DS);
- Warn_On_Instance := False;
-- The other case for a warning is a reverse loop
-- where the upper bound is the integer literal