]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] Tune detection of internally generated positional aggregates
authorPiotr Trojanek <trojanek@adacore.com>
Tue, 27 Jul 2021 13:00:39 +0000 (15:00 +0200)
committerPierre-Marie de Rodat <derodat@adacore.com>
Thu, 23 Sep 2021 13:06:16 +0000 (13:06 +0000)
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

index 732f0f39a48f3c3d5e7a9df15fa795a382a997aa..c4c4d9152dcdf77453d003478b2b36ed93be6370 100644 (file)
@@ -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;