]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Fix handling of actual subtypes for expanded names
authorPiotr Trojanek <trojanek@adacore.com>
Mon, 25 Sep 2023 22:17:12 +0000 (00:17 +0200)
committerMarc Poulhiès <poulhies@adacore.com>
Tue, 7 Nov 2023 09:15:01 +0000 (10:15 +0100)
gcc/ada/

* sem_util.adb
(Get_Actual_Subtype,Get_Actual_Subtype_If_Available): Fix handling
of expanded names.

gcc/ada/sem_util.adb

index 5440c6ae0aaed1d503fcd8262bda59ffa1e379eb..da531e53466cdc2c76b7727fd57e260792eb3fe3 100644 (file)
@@ -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