[Ada] Fix access to predicated parent in Itype
authorYannick Moy <moy@adacore.com>
Thu, 15 Jul 2021 12:31:29 +0000 (14:31 +0200)
committerPierre-Marie de Rodat <derodat@adacore.com>
Wed, 22 Sep 2021 15:01:45 +0000 (15:01 +0000)
gcc/ada/

* sem_ch13.adb (Build_Predicate_Functions): Access
Predicated_Parent only on subtypes.

gcc/ada/sem_ch13.adb

index 8cb3b42..2a5e86d 100644 (file)
@@ -10191,6 +10191,9 @@ package body Sem_Ch13 is
         or else
           (Is_Itype (Typ)
            and then not Comes_From_Source (Typ)
+           and then Ekind (Typ) in E_Array_Subtype
+                                 | E_Record_Subtype
+                                 | E_Record_Subtype_With_Private
            and then Present (Predicated_Parent (Typ)))
       then
          return;