aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEd Schonberg <schonber@gnat.com>2001-12-05 19:34:44 +0000
committerGeert Bosch <bosch@gcc.gnu.org>2001-12-05 20:34:44 +0100
commit2514b8392d938188b558ec4f4716e9b1e210dcf6 (patch)
treefdbaae35b14ff4a21548c437db0437c1007905d9
parent82ae78227426b93541799f27f4dfcf6b62166085 (diff)
downloadgcc-2514b8392d938188b558ec4f4716e9b1e210dcf6.zip
gcc-2514b8392d938188b558ec4f4716e9b1e210dcf6.tar.gz
gcc-2514b8392d938188b558ec4f4716e9b1e210dcf6.tar.bz2
sem_ch3.adb (Analyze_Object_Declaration): If expression is an aggregate with static wrong size...
* sem_ch3.adb (Analyze_Object_Declaration): If expression is an aggregate with static wrong size, attach generated Raise node to declaration. From-SVN: r47685
-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;