sem_ch8.adb (Find_Direct_Name): The left-hand side of an assignment may designate a generalized reference.

2012-10-02  Ed Schonberg  <schonberg@adacore.com>

	* sem_ch8.adb (Find_Direct_Name): The left-hand side of an
	assignment may designate a generalized reference.

From-SVN: r191976
This commit is contained in:
Ed Schonberg 2012-10-02 12:26:43 +00:00 committed by Arnaud Charlet
parent 7640ef8aba
commit 27dd0dde2d
2 changed files with 11 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2012-10-02 Ed Schonberg <schonberg@adacore.com>
* sem_ch8.adb (Find_Direct_Name): The left-hand side of an
assignment may designate a generalized reference.
2012-10-02 Eric Botcazou <ebotcazou@adacore.com>
* types.h (N_Return_Statement): Delete.

View File

@ -5021,10 +5021,15 @@ package body Sem_Ch8 is
Set_Entity_Or_Discriminal (N, E);
-- The name may designate a generalized reference, in which case
-- the dereference interpretation will be included.
if Ada_Version >= Ada_2012
and then
(Nkind (Parent (N)) in N_Subexpr
or else Nkind (Parent (N)) = N_Object_Declaration)
or else
Nkind_In (Parent (N), N_Object_Declaration,
N_Assignment_Statement))
then
Check_Implicit_Dereference (N, Etype (E));
end if;