https://gcc.gnu.org/g:d32a5294de92637680accd17d68421f485eaba32
commit r15-2669-gd32a5294de92637680accd17d68421f485eaba32 Author: Viljar Indus <in...@adacore.com> Date: Tue Jul 9 10:34:37 2024 +0300 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: --- gcc/ada/sem_util.adb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index 7901eb8ee387..7b575c09c302 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.