From 841fbb5a90810a351ea47c42607ea0bff0af733e Mon Sep 17 00:00:00 2001 From: charlet Date: Wed, 25 Apr 2012 15:12:34 +0000 Subject: 2012-04-25 Vincent Celier * 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 * sem_ch3.adb: Reverse_Storage_Order must be propagated to untagged derived record types. 2012-04-25 Ed Schonberg * 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 --- gcc/ada/sem_ch12.adb | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'gcc/ada/sem_ch12.adb') 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; -- cgit v1.2.1