From 797c14b5cd592ee5ded30f4c002a18e8a76de7d9 Mon Sep 17 00:00:00 2001 From: Piotr Trojanek Date: Mon, 13 Jul 2020 15:22:27 +0200 Subject: [PATCH] [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. --- gcc/ada/sem_ch3.adb | 10 ++++++++++ 1 file changed, 10 insertions(+) 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)); -- 2.30.2