aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ada/ChangeLog6
-rw-r--r--gcc/ada/sem_ch3.adb5
2 files changed, 11 insertions, 0 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index d402685..d49a0c7 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -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.
diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb
index 2b481bd..89c5ac6 100644
--- a/gcc/ada/sem_ch3.adb
+++ b/gcc/ada/sem_ch3.adb
@@ -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;