From: Piotr Trojanek Date: Mon, 13 Jul 2020 13:22:27 +0000 (+0200) Subject: [Ada] Propagate predicate function to a full view of a private subtype X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=797c14b5cd592ee5ded30f4c002a18e8a76de7d9;p=gcc.git [Ada] Propagate predicate function to a full view of a private subtype gcc/ada/ * sem_ch3.adb (Analyze_Subtype_Declaration): Propagate predicate function to full view of the created type as well, if it was created. --- diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index 8fe118b078e..91e4ebb6e41 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -5713,6 +5713,16 @@ package body Sem_Ch3 is then Set_Subprograms_For_Type (Id, Subprograms_For_Type (T)); + -- If the current declaration created both a private and a full view, + -- then propagate Predicate_Function to the latter as well. + + if Present (Full_View (Id)) + and then No (Predicate_Function (Full_View (Id))) + then + Set_Subprograms_For_Type + (Full_View (Id), Subprograms_For_Type (Id)); + end if; + if Has_Static_Predicate (T) then Set_Has_Static_Predicate (Id); Set_Static_Discrete_Predicate (Id, Static_Discrete_Predicate (T));