]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Remove dead code
authorRonan Desplanques <desplanques@adacore.com>
Thu, 13 Feb 2025 13:19:58 +0000 (14:19 +0100)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Fri, 6 Jun 2025 08:37:04 +0000 (10:37 +0200)
The code this patch removes is never executed on any of the available
test suites. The patch that introduced it mentions that it fixes a test
in particular, but that test passes anyway today.

gcc/ada/ChangeLog:

* sem_ch8.adb (Premature_Usage): Remove dead code.

gcc/ada/sem_ch8.adb

index 65d30967ae02dd823fc60192a363c4ec45b03944..fe9328833df446230374d1c1e5b689e3a88df47d 100644 (file)
@@ -9922,28 +9922,8 @@ package body Sem_Ch8 is
 
    procedure Premature_Usage (N : Node_Id) is
       Kind : constant Node_Kind := Nkind (Parent (Entity (N)));
-      E    : Entity_Id := Entity (N);
 
    begin
-      --  Within an instance, the analysis of the actual for a formal object
-      --  does not see the name of the object itself. This is significant only
-      --  if the object is an aggregate, where its analysis does not do any
-      --  name resolution on component associations. (see 4717-008). In such a
-      --  case, look for the visible homonym on the chain.
-
-      if In_Instance and then Present (Homonym (E)) then
-         E := Homonym (E);
-         while Present (E) and then not In_Open_Scopes (Scope (E)) loop
-            E := Homonym (E);
-         end loop;
-
-         if Present (E) then
-            Set_Entity (N, E);
-            Set_Etype (N, Etype (E));
-            return;
-         end if;
-      end if;
-
       case Kind is
          when N_Component_Declaration =>
             Error_Msg_N