diff mbox series

[Ada] Refine types of variables for parsing formal object declarations

Message ID 20201216131535.GA69993@adacore.com
State New
Headers show
Series [Ada] Refine types of variables for parsing formal object declarations | expand

Commit Message

Pierre-Marie de Rodat Dec. 16, 2020, 1:15 p.m. UTC
Local variables in parsing of formal object declarations take only
positive values, so their types can be narrowed to Pos. Cleanup only;
semantics is unaffected.

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

gcc/ada/

	* par-ch12.adb (P_Formal_Object_Declarations): Refine types to
	Pos.
diff mbox series

Patch

diff --git a/gcc/ada/par-ch12.adb b/gcc/ada/par-ch12.adb
--- a/gcc/ada/par-ch12.adb
+++ b/gcc/ada/par-ch12.adb
@@ -423,12 +423,12 @@  package body Ch12 is
 
    procedure P_Formal_Object_Declarations (Decls : List_Id) is
       Decl_Node        : Node_Id;
-      Ident            : Nat;
+      Ident            : Pos;
       Not_Null_Present : Boolean := False;
-      Num_Idents       : Nat;
+      Num_Idents       : Pos;
       Scan_State       : Saved_Scan_State;
 
-      Idents : array (Int range 1 .. 4096) of Entity_Id;
+      Idents : array (Pos range 1 .. 4096) of Entity_Id;
       --  This array holds the list of defining identifiers. The upper bound
       --  of 4096 is intended to be essentially infinite, and we do not even
       --  bother to check for it being exceeded.