From f7d1b4a7e0328f8482145c5b3d6333b27e38a919 Mon Sep 17 00:00:00 2001 From: Piotr Trojanek Date: Tue, 27 Jul 2021 15:00:39 +0200 Subject: [PATCH] [Ada] Tune detection of internally generated positional aggregates gcc/ada/ * sem_aggr.adb (Resolve_Array_Aggregate): Only keep the bounds for internally generated attributes; otherwise, compute them anew. --- gcc/ada/sem_aggr.adb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gcc/ada/sem_aggr.adb b/gcc/ada/sem_aggr.adb index 732f0f3..c4c4d91 100644 --- a/gcc/ada/sem_aggr.adb +++ b/gcc/ada/sem_aggr.adb @@ -2800,7 +2800,10 @@ package body Sem_Aggr is -- Exp_Aggr.Convert_To_Positional, so we don't want to change those -- bounds. - if Present (Aggregate_Bounds (N)) and then not Others_Allowed then + if Present (Aggregate_Bounds (N)) + and then not Others_Allowed + and then not Comes_From_Source (N) + then Aggr_Low := Low_Bound (Aggregate_Bounds (N)); Aggr_High := High_Bound (Aggregate_Bounds (N)); end if; -- 2.7.4