diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2024-05-24 09:44:10 +0200 |
---|---|---|
committer | Marc Poulhiès <poulhies@adacore.com> | 2024-06-20 10:50:56 +0200 |
commit | c5d7daa37938984b931ae0825e9d3d72c748ab5a (patch) | |
tree | 71abe707f8fd494df477537693da5e8e0f69282e /gcc/ada | |
parent | e8e0306649a09f47c429b36b7fcf95eaff100095 (diff) | |
download | gcc-c5d7daa37938984b931ae0825e9d3d72c748ab5a.zip gcc-c5d7daa37938984b931ae0825e9d3d72c748ab5a.tar.gz gcc-c5d7daa37938984b931ae0825e9d3d72c748ab5a.tar.bz2 |
ada: Fix assertion failure during analysis of instantiation of formal package
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.
Diffstat (limited to 'gcc/ada')
-rw-r--r-- | gcc/ada/sem_ch12.adb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb index d05c7b6..8ace16a 100644 --- a/gcc/ada/sem_ch12.adb +++ b/gcc/ada/sem_ch12.adb @@ -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 := |