OSDN Git Service

2008-05-26 Thomas Quinot <quinot@adacore.com>
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 26 May 2008 13:43:43 +0000 (13:43 +0000)
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 26 May 2008 13:43:43 +0000 (13:43 +0000)
* exp_ch5.adb (Make_Tag_Ctrl_Assignment): Add missing guard on
condition for assignment to temporary.

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

gcc/ada/exp_ch5.adb

index 00ab0d6..8d8a281 100644 (file)
@@ -734,8 +734,8 @@ package body Exp_Ch5 is
               and then not No_Ctrl_Actions (N)
             then
                declare
-                  Proc : constant Entity_Id :=
-                           TSS (Base_Type (L_Type), TSS_Slice_Assign);
+                  Proc    : constant Entity_Id :=
+                              TSS (Base_Type (L_Type), TSS_Slice_Assign);
                   Actuals : List_Id;
 
                begin
@@ -872,7 +872,7 @@ package body Exp_Ch5 is
                --  explicit bounds of right and left hand sides.
 
                declare
-                  Proc    : constant Node_Id :=
+                  Proc    : constant Entity_Id :=
                               TSS (Base_Type (L_Type), TSS_Slice_Assign);
                   Actuals : List_Id;
 
@@ -4186,13 +4186,16 @@ package body Exp_Ch5 is
       if not Ctrl_Act then
          null;
 
-      --  The left hand side is an uninitialized temporary
+      --  The left hand side is an uninitialized temporary object
 
       elsif Nkind (L) = N_Type_Conversion
         and then Is_Entity_Name (Expression (L))
+        and then Nkind (Parent (Entity (Expression (L))))
+                   = N_Object_Declaration
         and then No_Initialization (Parent (Entity (Expression (L))))
       then
          null;
+
       else
          Append_List_To (Res,
            Make_Final_Call (