]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Call Semantics when analyzing a renamed package
authorViljar Indus <indus@adacore.com>
Thu, 29 May 2025 07:54:30 +0000 (10:54 +0300)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Thu, 3 Jul 2025 08:16:20 +0000 (10:16 +0200)
Calling Semantics here will additionally update the reference to
Current_Sem_Unit the renamed unit so that we will not receive
bogus visibility errors when checking for self-referential with-s.

gcc/ada/ChangeLog:

* sem_ch10.adb(Analyze_With_Clause): Call Semantics instead
of Analyze to bring Current_Sem_Unit up to date.

gcc/ada/sem_ch10.adb

index 3a44149aeffcdf5854b892626dde331346597814..f58513d115fb39ae227e6aa8b1365ea26f3476ac 100644 (file)
@@ -3299,7 +3299,7 @@ package body Sem_Ch10 is
             --  the renamed unit, and the renaming declaration itself has not
             --  been analyzed.
 
-            Analyze (Parent (Parent (Entity (Pref))));
+            Semantics (Parent (Parent (Entity (Pref))));
             pragma Assert (Renamed_Entity (Entity (Pref)) = Par_Name);
             Par_Name := Entity (Pref);
          end if;