]> gcc.gnu.org Git - gcc.git/commitdiff
sem_ch5.adb (Analyze_Iteration_Scheme): Suppress warning on null loop in generic...
authorRobert Dewar <dewar@gnat.com>
Fri, 12 Oct 2001 00:28:21 +0000 (00:28 +0000)
committerGeert Bosch <bosch@gcc.gnu.org>
Fri, 12 Oct 2001 00:28:21 +0000 (02:28 +0200)
* sem_ch5.adb (Analyze_Iteration_Scheme): Suppress warning on null
loop in generic instance, since this is likely not very useful.

From-SVN: r46215

gcc/ada/ChangeLog
gcc/ada/sem_ch5.adb

index b21f3c51ae541f04bee02d93e89014596b4fd493..942f41849b99ad3eea99737fdc6d81aa8ea84536 100644 (file)
@@ -1,3 +1,8 @@
+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 
index 658a685ced77ac5b8a1a04cd98ecc8468573328b..5fc1585077fd5f31815f5086ff76bbb41392dd27 100644 (file)
@@ -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
This page took 0.075544 seconds and 5 git commands to generate.