summaryrefslogtreecommitdiff
path: root/gcc/ada/exp_ch13.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2011-08-03 08:02:56 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2011-08-03 08:02:56 +0000
commit349db2317aa9c9c33a0b55bf76cfb65c6e0ebd6f (patch)
treef799ddc9473294fcea2b4faca5462e7c472648ec /gcc/ada/exp_ch13.adb
parenta5ea7ace8312a19bff4dd99c73595634ab5aaa77 (diff)
downloadgcc-349db2317aa9c9c33a0b55bf76cfb65c6e0ebd6f.tar.gz
2011-08-03 Gary Dismukes <dismukes@adacore.com>
* sem_aggr.adb (Analyze_Array_Aggregate): When checking the discrete choices of a named array aggregate, bail out when any choices are marked as Errors_Posted. 2011-08-03 Ed Schonberg <schonberg@adacore.com> * exp_ch13.adb (Expand_N_Freeze_Entity): cleanup determination of scope in which entity is frozen, to handle properly loop variables in iterators. 2011-08-03 Ed Schonberg <schonberg@adacore.com> * sem_res.adb (Set_String_Literal_Subtype): if the lower bound of the subtype is not static, compute the upper bound using attributes, to handle properly index types that are not integer types. 2011-08-03 Bob Duff <duff@adacore.com> * gnat_rm.texi, gnat_ugn.texi: Fix some dangling URLs. Update copyright notice. 2011-08-03 Ed Schonberg <schonberg@adacore.com> * sem_ch3.adb (Build_Discriminant_Constraints): Only use Original_Discriminant if within an instance. * sem_ch4.adb (Analyze_Selected_Component): Ditto. 2011-08-03 Thomas Quinot <quinot@adacore.com> * einfo.ads: Minor reformatting. 2011-08-03 Ed Schonberg <schonberg@adacore.com> * exp_disp.adb (Check_Premature_Freezing): diagnose the presence of a composite type with an unfrozen subcomponent, in the profile of a primitive operation. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@177236 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/exp_ch13.adb')
-rw-r--r--gcc/ada/exp_ch13.adb21
1 files changed, 12 insertions, 9 deletions
diff --git a/gcc/ada/exp_ch13.adb b/gcc/ada/exp_ch13.adb
index 39b32cec46d..dbf664c5bad 100644
--- a/gcc/ada/exp_ch13.adb
+++ b/gcc/ada/exp_ch13.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2010, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2011, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -43,7 +43,6 @@ with Sem_Eval; use Sem_Eval;
with Sem_Util; use Sem_Util;
with Sinfo; use Sinfo;
with Snames; use Snames;
-with Stand; use Stand;
with Tbuild; use Tbuild;
with Uintp; use Uintp;
with Validsw; use Validsw;
@@ -213,7 +212,6 @@ package body Exp_Ch13 is
procedure Expand_N_Freeze_Entity (N : Node_Id) is
E : constant Entity_Id := Entity (N);
E_Scope : Entity_Id;
- S : Entity_Id;
In_Other_Scope : Boolean;
In_Outer_Scope : Boolean;
Decl : Node_Id;
@@ -306,13 +304,18 @@ package body Exp_Ch13 is
E_Scope := Corresponding_Spec (Unit_Declaration_Node (E_Scope));
end if;
- S := Current_Scope;
- while S /= Standard_Standard and then S /= E_Scope loop
- S := Scope (S);
- end loop;
+ -- If the scope of the entity is in open scopes, it is the current one
+ -- or an enclosing one, including a loop, a block, or a subprogram.
- In_Other_Scope := not (S = E_Scope);
- In_Outer_Scope := (not In_Other_Scope) and then (S /= Current_Scope);
+ if In_Open_Scopes (E_Scope) then
+ In_Other_Scope := False;
+ In_Outer_Scope := E_Scope /= Current_Scope;
+
+ -- Otherwise it is a local package or a different compilation unit.
+ else
+ In_Other_Scope := True;
+ In_Outer_Scope := False;
+ end if;
-- If the entity being frozen is defined in a scope that is not
-- currently on the scope stack, we must establish the proper