OSDN Git Service

2006-02-17 Ed Schonberg <schonberg@adacore.com>
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 17 Feb 2006 16:07:43 +0000 (16:07 +0000)
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 17 Feb 2006 16:07:43 +0000 (16:07 +0000)
* 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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@111191 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ada/sem_ch10.adb

index 00df65b..210a23c 100644 (file)
@@ -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