]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Factorize return statement
authorRonan Desplanques <desplanques@adacore.com>
Fri, 28 Mar 2025 11:58:36 +0000 (12:58 +0100)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Thu, 12 Jun 2025 08:37:50 +0000 (10:37 +0200)
Code cleanup; behavior is unaffected.

gcc/ada/ChangeLog:

* sem_ch3.adb (Constrain_Index): Factorize return statement.

gcc/ada/sem_ch3.adb

index e56ec5be0259309c7cf6a2ef4b0b3ea27d48b9d1..a5df3f89dac62211fdf03bcbce96eb041b77ce36 100644 (file)
@@ -15315,13 +15315,12 @@ package body Sem_Ch3 is
                   S, Entity (S));
             end if;
 
-            return;
-
          else
             Error_Msg_N ("invalid index constraint", S);
             Rewrite (S, New_Occurrence_Of (T, Sloc (S)));
-            return;
          end if;
+
+         return;
       end if;
 
       --  Complete construction of the Itype