A local variable that is used as a counter (which is clear from both its
comment and its used) will only be assigned with natural numbers. This
is now reflected in its type. Code cleanup only; semantics is
unaffected.

Tested on x86_64-pc-linux-gnu, committed on trunk

2020-06-11  Piotr Trojanek  <troja...@adacore.com>

gcc/ada/

        * sem_aggr.adb (Resolve_Record_Aggregate): Refine type of
        Others_Box.
--- gcc/ada/sem_aggr.adb
+++ gcc/ada/sem_aggr.adb
@@ -3283,7 +3283,7 @@ package body Sem_Aggr is
 
       Box_Node       : Node_Id := Empty;
       Is_Box_Present : Boolean := False;
-      Others_Box     : Integer := 0;
+      Others_Box     : Natural := 0;
       --  Ada 2005 (AI-287): Variables used in case of default initialization
       --  to provide a functionality similar to Others_Etype. Box_Present
       --  indicates that the component takes its default initialization;

Reply via email to