]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Fix assertion failure during analysis of instantiation of formal package
authorEric Botcazou <ebotcazou@adacore.com>
Fri, 24 May 2024 07:44:10 +0000 (09:44 +0200)
committerMarc Poulhiès <poulhies@adacore.com>
Thu, 20 Jun 2024 08:50:56 +0000 (10:50 +0200)
It's an assertion on the name of an instance of a generic child unit and
it needs to cope with a renaming of the unit.

gcc/ada/

* sem_ch12.adb (Instantiate_Formal_Package): Accept renamings of a
generic parent that is a child unit for the abbreviated instance.

gcc/ada/sem_ch12.adb

index d05c7b6119464df5f6f0dc9f35951c59fe39ed5b..8ace16ad0089e0d92aed7cdc9d3c4ce115924214 100644 (file)
@@ -10996,7 +10996,8 @@ package body Sem_Ch12 is
                if Is_Child_Unit (Gen_Parent) then
                   I_Nam :=
                     New_Copy_Tree (Name (Original_Node (Analyzed_Formal)));
-                  pragma Assert (Entity (I_Nam) = Gen_Parent);
+                  pragma Assert (Entity (I_Nam) = Gen_Parent
+                    or else Renamed_Entity (Entity (I_Nam)) = Gen_Parent);
 
                else
                   I_Nam :=