[Ada] Handle subtype_indication in 'Update for arrays
authorPiotr Trojanek <trojanek@adacore.com>
Tue, 8 Sep 2020 21:04:13 +0000 (23:04 +0200)
committerPierre-Marie de Rodat <derodat@adacore.com>
Mon, 26 Oct 2020 08:58:51 +0000 (04:58 -0400)
gcc/ada/

* exp_attr.adb (Expand_Update_Attribute): Handle
subtype_indication just like in Expand_Delta_Array_Aggregate.

gcc/ada/exp_attr.adb

index d3468d5e58f94c40e3041e748c86d4d2f864f637..f95c682a638687ba393507371306aaf79329bac5 100644 (file)
@@ -8164,6 +8164,9 @@ package body Exp_Attr is
          while Present (Comp) loop
             if Nkind (Comp) = N_Range then
                Process_Range_Update (Temp, Comp, Expr, Typ);
+            elsif Nkind (Comp) = N_Subtype_Indication then
+               Process_Range_Update
+                 (Temp, Range_Expression (Constraint (Comp)), Expr, Typ);
             else
                Process_Component_Or_Element_Update (Temp, Comp, Expr, Typ);
             end if;