From 15201a89d3bb11761cc9eb1a3e44c3bedb4a3c3f Mon Sep 17 00:00:00 2001 From: charlet Date: Wed, 26 Mar 2008 07:38:40 +0000 Subject: 2008-03-26 Ed Schonberg * sem_ch3.adb (Access_Definition): If the access type is the return result of a protected function, create an itype reference for it because usage will be in an inner scope from the point of declaration. (Build_Derived_Record_Type): Inherit Reverse_Bit_Order and OK_To_Reorder_Components. (Make_Index): If an overloaded range includes a universal integer interpretation, resolve to Standard.Integer. (Analyze_Subtype_Indication): Copy Convention to subtype (Check_Abstract_Interfaces): Complete semantic checks on the legality of limited an synchronized progenitors in type declaration and private extension declarations. * exp_ch13.adb (Expand_N_Freeze_Entity): If the scope of the entity is a protected subprogram body, determine proper scope from subprogram declaration. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@133561 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ada/exp_ch13.adb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'gcc/ada/exp_ch13.adb') diff --git a/gcc/ada/exp_ch13.adb b/gcc/ada/exp_ch13.adb index 9c39c1c4a83..11b3fef8861 100644 --- a/gcc/ada/exp_ch13.adb +++ b/gcc/ada/exp_ch13.adb @@ -212,13 +212,19 @@ package body Exp_Ch13 is -- expanded away. The same is true for entities in task types, in -- particular the parameter records of entries (Entities in bodies are -- all frozen within the body). If we are in the task body, this is a - -- proper scope. + -- proper scope. If we are within a subprogram body, the proper scope + -- is the corresponding spec. This may happen for itypes generated in + -- the bodies of protected operations. if Ekind (E_Scope) = E_Protected_Type or else (Ekind (E_Scope) = E_Task_Type and then not Has_Completion (E_Scope)) then E_Scope := Scope (E_Scope); + + elsif Ekind (E_Scope) = E_Subprogram_Body then + E_Scope := Corresponding_Spec (Unit_Declaration_Node (E_Scope)); + end if; S := Current_Scope; -- cgit v1.2.1