sem_ch8.adb (Find_Direct_Name): The left-hand side of an assignment may designate...
authorEd Schonberg <schonberg@adacore.com>
Tue, 2 Oct 2012 12:26:43 +0000 (12:26 +0000)
committerArnaud Charlet <charlet@gcc.gnu.org>
Tue, 2 Oct 2012 12:26:43 +0000 (14:26 +0200)
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

gcc/ada/ChangeLog
gcc/ada/sem_ch8.adb

index 436651cfe970dab4dbc6d9195bcaf596a3b07482..ac3238876aba6800b775166f9a08002584dcd4b4 100644 (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.
index 53ff3274e8ba63d2ab57843ef1a6bc151884f35b..db47b4a3e74ba2ba599c81a507100140504f5fe6 100644 (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;