From: Piotr Trojanek Date: Mon, 25 Sep 2023 22:17:12 +0000 (+0200) Subject: ada: Fix handling of actual subtypes for expanded names X-Git-Tag: basepoints/gcc-15~4950 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b618441a25a5ab963f26a8415eb43c87cfcf6505;p=thirdparty%2Fgcc.git ada: Fix handling of actual subtypes for expanded names gcc/ada/ * sem_util.adb (Get_Actual_Subtype,Get_Actual_Subtype_If_Available): Fix handling of expanded names. --- diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index 5440c6ae0aae..da531e53466c 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -10104,7 +10104,7 @@ package body Sem_Util is -- formal, or a variable or constant object, then we get the actual -- subtype from the referenced entity if one has been built. - if Nkind (N) = N_Identifier + if Nkind (N) in N_Identifier | N_Expanded_Name and then (Is_Formal (Entity (N)) or else Ekind (Entity (N)) = E_Constant @@ -10225,7 +10225,7 @@ package body Sem_Util is -- formal, or a variable or constant object, then we get the actual -- subtype from the referenced entity if one has been built. - if Nkind (N) = N_Identifier + if Nkind (N) in N_Identifier | N_Expanded_Name and then (Is_Formal (Entity (N)) or else Ekind (Entity (N)) = E_Constant