sem_ch3.adb (Analyze_Object_Declaration): If expression is an aggregate with static...
authorEd Schonberg <schonber@gnat.com>
Wed, 5 Dec 2001 19:34:44 +0000 (19:34 +0000)
committerGeert Bosch <bosch@gcc.gnu.org>
Wed, 5 Dec 2001 19:34:44 +0000 (20:34 +0100)
* sem_ch3.adb (Analyze_Object_Declaration): If expression is an
aggregate with static wrong size, attach generated Raise node to
declaration.

From-SVN: r47685

gcc/ada/ChangeLog
gcc/ada/sem_ch3.adb

index d402685bdff8cfb8caff7e6ef518ba0e3c5241b4..d49a0c7c79fc8cf2ac632d56b324abe34a2d5f7a 100644 (file)
@@ -1,3 +1,9 @@
+2001-12-05  Ed Schonberg <schonber@gnat.com>
+
+       * sem_ch3.adb (Analyze_Object_Declaration): If expression is an 
+       aggregate with static wrong size, attach generated Raise node to 
+       declaration.
+
 2001-12-05  Robert Dewar <dewar@gnat.com>
 
        * sem_attr.adb (Analyze_Attribute): Defend against bad Val attribute. 
index 2b481bdfe76d6741e72011101b0043017e7b7adc..89c5ac6d59a1acb5a55dfbc58eb30b151ee2824d 100644 (file)
@@ -1604,6 +1604,11 @@ package body Sem_Ch3 is
          if not Is_Constrained (T) then
             null;
 
+         elsif Nkind (E) = N_Raise_Constraint_Error then
+            --  Aggregate is statically illegal. Place back in declaration.
+            Set_Expression (N, E);
+            Set_No_Initialization (N, False);
+
          elsif T = Etype (E) then
             null;