From: Eric Botcazou <ebotca...@adacore.com>

The Defining_Identifier of a renaming may be a E_Constant in the context.

gcc/ada/

        PR ada/114710
        * exp_util.adb (Find_Renamed_Object): Recurse for any renaming.

Tested on x86_64-pc-linux-gnu, committed on master.

---
 gcc/ada/exp_util.adb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb
index bf95b0e13c8..6e2168a80e9 100644
--- a/gcc/ada/exp_util.adb
+++ b/gcc/ada/exp_util.adb
@@ -8881,7 +8881,7 @@ package body Exp_Util is
             --  Recurse if Ren_Obj is itself a renaming
 
             if Present (Ren_Obj)
-              and then Ekind (Ren_Obj) = E_Variable
+              and then Ekind (Ren_Obj) in E_Constant | E_Variable
               and then Present (Renamed_Object (Ren_Obj))
             then
                return Find_Renamed_Object (Declaration_Node (Ren_Obj));
-- 
2.45.1

Reply via email to