aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPiotr Trojanek <trojanek@adacore.com>2020-05-14 22:08:09 +0200
committerPierre-Marie de Rodat <derodat@adacore.com>2020-07-07 05:26:59 -0400
commite082411903f528de5cc48ba206c5f5253861e65d (patch)
treebaf80fec7aab01672e1051beaab8e772447d5b89
parent8bda08f130cfc0d210386d484c68daa4e4140313 (diff)
downloadgcc-e082411903f528de5cc48ba206c5f5253861e65d.zip
gcc-e082411903f528de5cc48ba206c5f5253861e65d.tar.gz
gcc-e082411903f528de5cc48ba206c5f5253861e65d.tar.bz2
[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.
-rw-r--r--gcc/ada/sem_ch8.adb7
1 files changed, 3 insertions, 4 deletions
diff --git a/gcc/ada/sem_ch8.adb b/gcc/ada/sem_ch8.adb
index 0fcccc9..befd4a8 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));