]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] Also deal with private actual types in latest change
authorEric Botcazou <ebotcazou@adacore.com>
Fri, 24 Jun 2022 17:28:53 +0000 (19:28 +0200)
committerPierre-Marie de Rodat <derodat@adacore.com>
Wed, 13 Jul 2022 10:01:21 +0000 (10:01 +0000)
gcc/ada/

* gcc-interface/decl.cc (Gigi_Cloned_Subtype): Handle private case.

gcc/ada/gcc-interface/decl.cc

index 8449c991e2b6e3b6df08abc01c5f955da94f31c7..53c84613e6a1e7b52d3f308c0960e3c5beaee680 100644 (file)
@@ -5171,6 +5171,19 @@ Gigi_Cloned_Subtype (Entity_Id gnat_entity)
          && Present (Generic_Parent_Type (gnat_decl))
          && Is_Entity_Name (Subtype_Indication (gnat_decl)))
        return Entity (Subtype_Indication (gnat_decl));
+
+      /* Likewise for the full view of such subtypes when they are private.  */
+      if (Is_Itype (gnat_entity))
+       {
+         gnat_decl = Associated_Node_For_Itype (gnat_entity);
+         if (Present (gnat_decl)
+             && Nkind (gnat_decl) == N_Subtype_Declaration
+             && Is_Private_Type (Defining_Identifier (gnat_decl))
+             && Full_View (Defining_Identifier (gnat_decl)) == gnat_entity
+             && Present (Generic_Parent_Type (gnat_decl))
+             && Is_Entity_Name (Subtype_Indication (gnat_decl)))
+           return Entity (Subtype_Indication (gnat_decl));
+       }
       break;
 
     default: