OSDN Git Service

* doc/install.texi (xtensa-*-elf): New target.
[pf3gnuchains/gcc-fork.git] / gcc / ada / exp_ch3.adb
index 76520cf..22d8426 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---                            $Revision: 1.481 $
+--                            $Revision: 1.2 $
 --                                                                          --
 --          Copyright (C) 1992-2001 Free Software Foundation, Inc.          --
 --                                                                          --
@@ -4210,20 +4210,14 @@ package body Exp_Ch3 is
       then
          pragma Assert (Init_Or_Norm_Scalars);
 
-         --  Build aggregate with an explicit qualification, because it
-         --  may otherwise be ambiguous in context.
-
          return
-           Make_Qualified_Expression (Loc,
-             Subtype_Mark => New_Occurrence_Of (T, Loc),
-             Expression =>
-               Make_Aggregate (Loc,
-                 Component_Associations => New_List (
-                   Make_Component_Association (Loc,
-                     Choices => New_List (
-                       Make_Others_Choice (Loc)),
-                     Expression =>
-                       Get_Simple_Init_Val (Component_Type (T), Loc)))));
+           Make_Aggregate (Loc,
+             Component_Associations => New_List (
+               Make_Component_Association (Loc,
+                 Choices => New_List (
+                   Make_Others_Choice (Loc)),
+                 Expression =>
+                   Get_Simple_Init_Val (Component_Type (T), Loc))));
 
       --  Access type is initialized to null
 
@@ -4267,8 +4261,12 @@ package body Exp_Ch3 is
 
          --  A special case, if the underlying value is null, then qualify
          --  it with the underlying type, so that the null is properly typed
+         --  Similarly, if it is an aggregate it must be qualified, because
+         --  an unchecked conversion does not provide a context for it.
 
-         if Nkind (Val) = N_Null then
+         if Nkind (Val) = N_Null
+           or else Nkind (Val) = N_Aggregate
+         then
             Val :=
               Make_Qualified_Expression (Loc,
                 Subtype_Mark =>
@@ -4870,7 +4868,7 @@ package body Exp_Ch3 is
       if For_Body then
          return Make_Subprogram_Body (Loc, Spec, Empty_List, Empty);
 
-      --  For the case of _Input and _Ouput applied to an abstract type,
+      --  For the case of _Input and _Output applied to an abstract type,
       --  generate abstract specifications. These will never be called,
       --  but we need the slots allocated in the dispatching table so
       --  that typ'Class'Input and typ'Class'Output will work properly.