https://gcc.gnu.org/g:fd87cba805163b6bf9936fbc22deb7995e2dc2c0
commit r16-1214-gfd87cba805163b6bf9936fbc22deb7995e2dc2c0 Author: Ronan Desplanques <desplanq...@adacore.com> Date: Thu Feb 13 14:19:58 2025 +0100 ada: Remove dead code 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. Diff: --- gcc/ada/sem_ch8.adb | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/gcc/ada/sem_ch8.adb b/gcc/ada/sem_ch8.adb index 65d30967ae02..fe9328833df4 100644 --- a/gcc/ada/sem_ch8.adb +++ b/gcc/ada/sem_ch8.adb @@ -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