diff options
author | Ed Schonberg <schonberg@adacore.com> | 2006-02-17 17:07:43 +0100 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2006-02-17 17:07:43 +0100 |
commit | 9af38f0c56e8dd7a894328682c92446216c4f9a5 (patch) | |
tree | 748a943fc9a952c622935ff6f8c86fa8da02fdbd /gcc/ada/sem_ch10.adb | |
parent | f58291a11408d0f4bf298186070fa3fc6c00b109 (diff) | |
download | gcc-9af38f0c56e8dd7a894328682c92446216c4f9a5.tar.gz |
sem_ch10.adb (Analyze_With_Clause): If the unit is a subprogram instantiation...
2006-02-17 Ed Schonberg <schonberg@adacore.com>
* sem_ch10.adb (Analyze_With_Clause): If the unit is a subprogram
instantiation, the corresponding entity is the related_instance of the
wrapper package created for the instance.
From-SVN: r111191
Diffstat (limited to 'gcc/ada/sem_ch10.adb')
-rw-r--r-- | gcc/ada/sem_ch10.adb | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/gcc/ada/sem_ch10.adb b/gcc/ada/sem_ch10.adb index 00df65bb0dc..210a23c5311 100644 --- a/gcc/ada/sem_ch10.adb +++ b/gcc/ada/sem_ch10.adb @@ -2180,16 +2180,11 @@ package body Sem_Ch10 is elsif Unit_Kind in N_Subprogram_Instantiation then - -- Instantiation node is replaced with a package that contains - -- renaming declarations and instance itself. The subprogram - -- Instance is declared in the visible part of the wrapper package. - - E_Name := First_Entity (Defining_Entity (U)); - while Present (E_Name) loop - exit when Is_Subprogram (E_Name) - and then Is_Generic_Instance (E_Name); - E_Name := Next_Entity (E_Name); - end loop; + -- Instantiation node is replaced with a wrapper package. + -- Retrieve the visible subprogram created by the instance from + -- the corresponding attribute of the wrapper. + + E_Name := Related_Instance (Defining_Entity (U)); elsif Unit_Kind = N_Package_Renaming_Declaration or else Unit_Kind in N_Generic_Renaming_Declaration |