]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Fix oversight in latest finalization fix
authorEric Botcazou <ebotcazou@adacore.com>
Thu, 25 Apr 2024 14:05:33 +0000 (16:05 +0200)
committerMarc Poulhiès <poulhies@adacore.com>
Thu, 13 Jun 2024 13:30:30 +0000 (15:30 +0200)
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.

gcc/ada/exp_util.adb

index bf95b0e13c857ae90a385d6b60c6138b6f13693b..6e2168a80e9049054793c93c7c51660c8cfbb646 100644 (file)
@@ -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));