gcc/ada/
authorsam <sam@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 5 Dec 2007 09:25:38 +0000 (09:25 +0000)
committersam <sam@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 5 Dec 2007 09:25:38 +0000 (09:25 +0000)
PR ada/21489
* exp_ch9.adb (Build_Simple_Entry_Call): Initialize OUT access type
parameters of an entry call.

    gcc/testsuite/
PR ada/21489
* gnat.dg/rm_6_4_1_13.adb: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@130617 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ada/ChangeLog
gcc/ada/exp_ch9.adb
gcc/testsuite/ChangeLog

index 54f3d5c..0fcdaad 100644 (file)
@@ -1,3 +1,9 @@
+2007-12-05  Samuel Tardieu  <sam@rfc1149.net>
+
+       PR ada/21489
+       * exp_ch9.adb (Build_Simple_Entry_Call): Initialize OUT access type
+       parameters of an entry call.
+
 2007-12-03  Robert Dewar <dewar@adacore.com>
             Samuel Tardieu  <sam@rfc1149.net>
 
index 87fbc12..78b1155 100644 (file)
@@ -3024,8 +3024,12 @@ package body Exp_Ch9 is
                   --  We have to make an assignment statement separate for the
                   --  case of limited type. We cannot assign it unless the
                   --  Assignment_OK flag is set first.
+                  --  An out formal of an access type must also be initialized
+                  --  from the actual, as stated in RM 6.4.1 (13).
 
-                  if Ekind (Formal) /= E_Out_Parameter then
+                  if Ekind (Formal) /= E_Out_Parameter
+                    or else Is_Access_Type (Etype (Formal))
+                  then
                      N_Var :=
                        New_Reference_To (Defining_Identifier (N_Node), Loc);
                      Set_Assignment_OK (N_Var);
index f903d83..a58e365 100644 (file)
@@ -1,3 +1,8 @@
+2007-12-05  Samuel Tardieu  <sam@rfc1149.net>
+
+       PR ada/21489
+       * gnat.dg/rm_6_4_1_13.adb: New test.
+
 2007-12-04  Jakub Jelinek  <jakub@redhat.com>
 
        PR middle-end/34134