summaryrefslogtreecommitdiff
path: root/gcc/ada/sem_ch12.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2012-04-25 15:12:34 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2012-04-25 15:12:34 +0000
commit841fbb5a90810a351ea47c42607ea0bff0af733e (patch)
treef6ae78dc92a93c3dcc28c325109924304a992559 /gcc/ada/sem_ch12.adb
parent9a2639fcdb7f82ff6f0eb7120ee3314cd965158b (diff)
downloadgcc-841fbb5a90810a351ea47c42607ea0bff0af733e.tar.gz
2012-04-25 Vincent Celier <celier@adacore.com>
* sem_ch12.adb (Inherit_Context): Compare library units, not names of units, when checking if a unit is already in the context. 2012-04-25 Thomas Quinot <quinot@adacore.com> * sem_ch3.adb: Reverse_Storage_Order must be propagated to untagged derived record types. 2012-04-25 Ed Schonberg <schonberg@adacore.com> * lib-xref.adb: Adjust position of end label. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186827 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/sem_ch12.adb')
-rw-r--r--gcc/ada/sem_ch12.adb12
1 files changed, 7 insertions, 5 deletions
diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb
index d0525633681..a5360d4ac5f 100644
--- a/gcc/ada/sem_ch12.adb
+++ b/gcc/ada/sem_ch12.adb
@@ -7761,8 +7761,9 @@ package body Sem_Ch12 is
Item : Node_Id;
New_I : Node_Id;
- Clause : Node_Id;
- OK : Boolean;
+ Clause : Node_Id;
+ OK : Boolean;
+ Lib_Unit : Node_Id;
begin
if Nkind (Parent (Gen_Decl)) = N_Compilation_Unit then
@@ -7784,17 +7785,18 @@ package body Sem_Ch12 is
Item := First (Context_Items (Parent (Gen_Decl)));
while Present (Item) loop
if Nkind (Item) = N_With_Clause then
+ Lib_Unit := Library_Unit (Item);
- -- Take care to prevent direct cyclic with's.
+ -- Take care to prevent direct cyclic with's
- if Library_Unit (Item) /= Current_Unit then
+ if Lib_Unit /= Current_Unit then
-- Do not add a unit if it is already in the context
Clause := First (Current_Context);
OK := True;
while Present (Clause) loop
if Nkind (Clause) = N_With_Clause and then
- Chars (Name (Clause)) = Chars (Name (Item))
+ Library_Unit (Clause) = Lib_Unit
then
OK := False;
exit;