https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114636

--- Comment #2 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
This appears to be sufficient:

diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb
index e7b759c4e88..c06377ab4c9 100644
--- a/gcc/ada/sem_ch12.adb
+++ b/gcc/ada/sem_ch12.adb
@@ -6696,8 +6696,12 @@ package body Sem_Ch12 is
          then
             --  If the formal is a tagged type the corresponding class-wide
             --  type has been generated as well, and it must be skipped.
+            --  Likewise, for a formal discrete type, the base type has been
+            --  generated as well (see Analyze_Formal_Discrete_Type).

-            if Is_Type (E2) and then Is_Tagged_Type (E2) then
+            if Is_Type (E2)
+              and then (Is_Tagged_Type (E2) or else Is_Enumeration_Type (E2))
+            then
                Next_Entity (E2);
             end if;

Reply via email to