]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Fix handling reference warnings with slices
authorViljar Indus <indus@adacore.com>
Tue, 9 Jul 2024 07:34:37 +0000 (10:34 +0300)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Fri, 2 Aug 2024 07:08:05 +0000 (09:08 +0200)
gcc/ada/

* sem_util.adb (Set_Referenced_Modified): Set referenced as LHS
for the prefixes of array slices.

gcc/ada/sem_util.adb

index 7901eb8ee387da53202b39fc638e60174286a78d..7b575c09c30295f432c884e350d82854b2c23ece 100644 (file)
@@ -27787,9 +27787,10 @@ package body Sem_Util is
       Pref : Node_Id;
 
    begin
-      --  Deal with indexed or selected component where prefix is modified
+      --  Deal with indexed components, selected components, or slices where
+      --  the prefix is modified.
 
-      if Nkind (N) in N_Indexed_Component | N_Selected_Component then
+      if Nkind (N) in N_Indexed_Component | N_Selected_Component | N_Slice then
 
          --  Grab the original node to avoid looking at internally generated
          --  objects.