From 2514b8392d938188b558ec4f4716e9b1e210dcf6 Mon Sep 17 00:00:00 2001 From: Ed Schonberg Date: Wed, 5 Dec 2001 19:34:44 +0000 Subject: 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 --- gcc/ada/ChangeLog | 6 ++++++ gcc/ada/sem_ch3.adb | 5 +++++ 2 files changed, 11 insertions(+) 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 + + * 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 * 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; -- cgit v1.1