From 7a17384884750622969e01b90344f6aa4fc9838c Mon Sep 17 00:00:00 2001 From: Piotr Trojanek Date: Thu, 15 Oct 2020 10:45:28 +0200 Subject: [PATCH] [Ada] Remove shadowing by a nested subprogram parameter gcc/ada/ * exp_ch8.adb (Expand_N_Exception_Renaming_Declaration): Move "Nam" constant after the body of a nested subprogram; change "T" from variable to constant. --- gcc/ada/exp_ch8.adb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gcc/ada/exp_ch8.adb b/gcc/ada/exp_ch8.adb index 9f4c65c89ba..facd12e0cbe 100644 --- a/gcc/ada/exp_ch8.adb +++ b/gcc/ada/exp_ch8.adb @@ -101,10 +101,6 @@ package body Exp_Ch8 is -- More comments needed for this para ??? procedure Expand_N_Object_Renaming_Declaration (N : Node_Id) is - Nam : constant Node_Id := Name (N); - Decl : Node_Id; - T : Entity_Id; - function Evaluation_Required (Nam : Node_Id) return Boolean; -- Determines whether it is necessary to do static name evaluation for -- renaming of Nam. It is considered necessary if evaluating the name @@ -165,6 +161,12 @@ package body Exp_Ch8 is end if; end Evaluation_Required; + -- Local variables + + Decl : Node_Id; + Nam : constant Node_Id := Name (N); + T : constant Entity_Id := Etype (Defining_Identifier (N)); + -- Start of processing for Expand_N_Object_Renaming_Declaration begin @@ -177,8 +179,6 @@ package body Exp_Ch8 is -- Deal with construction of subtype in class-wide case - T := Etype (Defining_Identifier (N)); - if Is_Class_Wide_Type (T) then Expand_Subtype_From_Expr (N, T, Subtype_Mark (N), Name (N)); Find_Type (Subtype_Mark (N)); -- 2.30.2