From e082411903f528de5cc48ba206c5f5253861e65d Mon Sep 17 00:00:00 2001 From: Piotr Trojanek Date: Thu, 14 May 2020 22:08:09 +0200 Subject: [PATCH] [Ada] Fix typo in code to get a better error message gcc/ada/ * sem_ch8.adb (Analyze_Use_Package): Replace low-level, error-prone Ekind_In tests with high-level Is_Generic_Subprogram and Is_Subprogram. --- gcc/ada/sem_ch8.adb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/gcc/ada/sem_ch8.adb b/gcc/ada/sem_ch8.adb index 0fcccc9c383..befd4a8efc5 100644 --- a/gcc/ada/sem_ch8.adb +++ b/gcc/ada/sem_ch8.adb @@ -3981,20 +3981,19 @@ package body Sem_Ch8 is Set_Prev_Use_Clause (N, Current_Use_Clause (Pack)); end if; - -- Mark all entities as potentially use visible. + -- Mark all entities as potentially use visible if Ekind (Pack) /= E_Package and then Etype (Pack) /= Any_Type then if Ekind (Pack) = E_Generic_Package then Error_Msg_N -- CODEFIX ("a generic package is not allowed in a use clause", Name (N)); - elsif Ekind_In (Pack, E_Generic_Function, E_Generic_Package) - then + elsif Is_Generic_Subprogram (Pack) then Error_Msg_N -- CODEFIX ("a generic subprogram is not allowed in a use clause", Name (N)); - elsif Ekind_In (Pack, E_Function, E_Procedure, E_Operator) then + elsif Is_Subprogram (Pack) then Error_Msg_N -- CODEFIX ("a subprogram is not allowed in a use clause", Name (N)); -- 2.30.2