From 2d80df423310f1c40a3a661d5587261ee9151288 Mon Sep 17 00:00:00 2001 From: Piotr Trojanek Date: Wed, 14 Oct 2020 16:22:16 +0200 Subject: [PATCH] [Ada] Remove dead and duplicated diagnostics for generic access types gcc/ada/ * sem_ch12.adb (Instantiate_Type): Remove extra whitespace. (Validate_Access_Type_Instance): Remove dead (and duplicated) code. --- gcc/ada/sem_ch12.adb | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb index ab68f720338..99a62c40c7a 100644 --- a/gcc/ada/sem_ch12.adb +++ b/gcc/ada/sem_ch12.adb @@ -12645,10 +12645,10 @@ package body Sem_Ch12 is Analyzed_Formal : Node_Id; Actual_Decls : List_Id) return List_Id is - A_Gen_T : constant Entity_Id := + A_Gen_T : constant Entity_Id := Defining_Identifier (Analyzed_Formal); - Def : constant Node_Id := Formal_Type_Definition (Formal); - Gen_T : constant Entity_Id := Defining_Identifier (Formal); + Def : constant Node_Id := Formal_Type_Definition (Formal); + Gen_T : constant Entity_Id := Defining_Identifier (Formal); Act_T : Entity_Id; Ancestor : Entity_Id := Empty; Decl_Node : Node_Id; @@ -12957,21 +12957,6 @@ package body Sem_Ch12 is Error_Msg_N ("\predicates do not match", Actual); end if; - Abandon_Instantiation (Actual); - - elsif Is_Access_Type (Designated_Type (Act_T)) - and then Is_Constrained (Designated_Type (Designated_Type (Act_T))) - /= - Is_Constrained (Designated_Type (Desig_Type)) - then - Error_Msg_NE - ("designated type of actual does not match that of formal &", - Actual, Gen_T); - - if not Predicates_Match (Desig_Type, Desig_Act) then - Error_Msg_N ("\predicates do not match", Actual); - end if; - Abandon_Instantiation (Actual); end if; -- 2.30.2