]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Remove unnecessary special handling
authorRonan Desplanques <desplanques@adacore.com>
Tue, 4 Mar 2025 13:29:07 +0000 (14:29 +0100)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Mon, 9 Jun 2025 06:32:07 +0000 (08:32 +0200)
This patch removes a special exemption in Enter_Name. That exemption was
preceded by a comment which described what situations it was supposed to
be required for, but it was unnecessary even in those situations.

gcc/ada/ChangeLog:

* sem_util.adb (Enter_Name): Remove special handling.

gcc/ada/sem_util.adb

index 523aff33f95a927000d2e937ea5a44b0f701c7b6..59bf060ee740d78e64082bad2ad283696dcb9d84 100644 (file)
@@ -8082,17 +8082,7 @@ package body Sem_Util is
 
       --  If we fall through, declaration is OK, at least OK enough to continue
 
-      --  If Def_Id is a discriminant or a record component we are in the midst
-      --  of inheriting components in a derived record definition. Preserve
-      --  their Ekind and Etype.
-
-      if Ekind (Def_Id) in E_Discriminant | E_Component then
-         null;
-
-      elsif Present (Etype (Def_Id)) then
-         null;
-
-      else
+      if No (Etype (Def_Id)) then
          Set_Etype (Def_Id, Any_Type); -- avoid cascaded errors
       end if;