From: Viljar Indus Date: Tue, 9 Jul 2024 07:34:37 +0000 (+0300) Subject: ada: Fix handling reference warnings with slices X-Git-Tag: basepoints/gcc-16~6884 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d32a5294de92637680accd17d68421f485eaba32;p=thirdparty%2Fgcc.git ada: Fix handling reference warnings with slices gcc/ada/ * sem_util.adb (Set_Referenced_Modified): Set referenced as LHS for the prefixes of array slices. --- diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index 7901eb8ee38..7b575c09c30 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -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.