aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorViljar Indus <indus@adacore.com>2024-07-09 10:34:37 +0300
committerMarc Poulhiès <dkm@gcc.gnu.org>2024-08-02 09:08:05 +0200
commitd32a5294de92637680accd17d68421f485eaba32 (patch)
treeb12a63b0dc6261b05911a53ad3fdd25f68a9ee19 /gcc
parente2fe0b18a66aafdd489ba9dbf148794906732f64 (diff)
downloadgcc-d32a5294de92637680accd17d68421f485eaba32.zip
gcc-d32a5294de92637680accd17d68421f485eaba32.tar.gz
gcc-d32a5294de92637680accd17d68421f485eaba32.tar.bz2
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.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/sem_util.adb5
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb
index 7901eb8..7b575c0 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.