summaryrefslogtreecommitdiff
path: root/gcc/ada/exp_ch13.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2008-03-26 07:38:40 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2008-03-26 07:38:40 +0000
commit15201a89d3bb11761cc9eb1a3e44c3bedb4a3c3f (patch)
tree3ec3ff84f377e5a9fd2ca954a00f375ec9408452 /gcc/ada/exp_ch13.adb
parent9aaf6f8ac311c6650c19db16577dbc0c1947e231 (diff)
downloadgcc-15201a89d3bb11761cc9eb1a3e44c3bedb4a3c3f.tar.gz
2008-03-26 Ed Schonberg <schonberg@adacore.com>
* 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
Diffstat (limited to 'gcc/ada/exp_ch13.adb')
-rw-r--r--gcc/ada/exp_ch13.adb8
1 files changed, 7 insertions, 1 deletions
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;